github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/route53recoverycontrol/routingControl.go (about) 1 // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. 2 // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 4 package route53recoverycontrol 5 6 import ( 7 "context" 8 "reflect" 9 10 "errors" 11 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 12 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 13 ) 14 15 // Provides an AWS Route 53 Recovery Control Config Routing Control. 16 // 17 // ## Example Usage 18 // 19 // <!--Start PulumiCodeChooser --> 20 // ```go 21 // package main 22 // 23 // import ( 24 // 25 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/route53recoverycontrol" 26 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 27 // 28 // ) 29 // 30 // func main() { 31 // pulumi.Run(func(ctx *pulumi.Context) error { 32 // _, err := route53recoverycontrol.NewRoutingControl(ctx, "example", &route53recoverycontrol.RoutingControlArgs{ 33 // Name: pulumi.String("tinlicker"), 34 // ClusterArn: pulumi.String("arn:aws:route53-recovery-control::881188118811:cluster/8d47920e-d789-437d-803a-2dcc4b204393"), 35 // }) 36 // if err != nil { 37 // return err 38 // } 39 // return nil 40 // }) 41 // } 42 // 43 // ``` 44 // <!--End PulumiCodeChooser --> 45 // 46 // <!--Start PulumiCodeChooser --> 47 // ```go 48 // package main 49 // 50 // import ( 51 // 52 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/route53recoverycontrol" 53 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 54 // 55 // ) 56 // 57 // func main() { 58 // pulumi.Run(func(ctx *pulumi.Context) error { 59 // _, err := route53recoverycontrol.NewRoutingControl(ctx, "example", &route53recoverycontrol.RoutingControlArgs{ 60 // Name: pulumi.String("thomasoliver"), 61 // ClusterArn: pulumi.String("arn:aws:route53-recovery-control::881188118811:cluster/8d47920e-d789-437d-803a-2dcc4b204393"), 62 // ControlPanelArn: pulumi.String("arn:aws:route53-recovery-control::428113431245:controlpanel/abd5fbfc052d4844a082dbf400f61da8"), 63 // }) 64 // if err != nil { 65 // return err 66 // } 67 // return nil 68 // }) 69 // } 70 // 71 // ``` 72 // <!--End PulumiCodeChooser --> 73 // 74 // ## Import 75 // 76 // Using `pulumi import`, import Route53 Recovery Control Config Routing Control using the routing control arn. For example: 77 // 78 // ```sh 79 // $ pulumi import aws:route53recoverycontrol/routingControl:RoutingControl mycontrol arn:aws:route53-recovery-control::313517334327:controlpanel/abd5fbfc052d4844a082dbf400f61da8/routingcontrol/d5d90e587870494b 80 // ``` 81 type RoutingControl struct { 82 pulumi.CustomResourceState 83 84 // ARN of the routing control. 85 Arn pulumi.StringOutput `pulumi:"arn"` 86 // ARN of the cluster in which this routing control will reside. 87 ClusterArn pulumi.StringOutput `pulumi:"clusterArn"` 88 // ARN of the control panel in which this routing control will reside. 89 ControlPanelArn pulumi.StringOutput `pulumi:"controlPanelArn"` 90 // The name describing the routing control. 91 // 92 // The following arguments are optional: 93 Name pulumi.StringOutput `pulumi:"name"` 94 // Status of routing control. `PENDING` when it is being created/updated, `PENDING_DELETION` when it is being deleted, and `DEPLOYED` otherwise. 95 Status pulumi.StringOutput `pulumi:"status"` 96 } 97 98 // NewRoutingControl registers a new resource with the given unique name, arguments, and options. 99 func NewRoutingControl(ctx *pulumi.Context, 100 name string, args *RoutingControlArgs, opts ...pulumi.ResourceOption) (*RoutingControl, error) { 101 if args == nil { 102 return nil, errors.New("missing one or more required arguments") 103 } 104 105 if args.ClusterArn == nil { 106 return nil, errors.New("invalid value for required argument 'ClusterArn'") 107 } 108 opts = internal.PkgResourceDefaultOpts(opts) 109 var resource RoutingControl 110 err := ctx.RegisterResource("aws:route53recoverycontrol/routingControl:RoutingControl", name, args, &resource, opts...) 111 if err != nil { 112 return nil, err 113 } 114 return &resource, nil 115 } 116 117 // GetRoutingControl gets an existing RoutingControl resource's state with the given name, ID, and optional 118 // state properties that are used to uniquely qualify the lookup (nil if not required). 119 func GetRoutingControl(ctx *pulumi.Context, 120 name string, id pulumi.IDInput, state *RoutingControlState, opts ...pulumi.ResourceOption) (*RoutingControl, error) { 121 var resource RoutingControl 122 err := ctx.ReadResource("aws:route53recoverycontrol/routingControl:RoutingControl", name, id, state, &resource, opts...) 123 if err != nil { 124 return nil, err 125 } 126 return &resource, nil 127 } 128 129 // Input properties used for looking up and filtering RoutingControl resources. 130 type routingControlState struct { 131 // ARN of the routing control. 132 Arn *string `pulumi:"arn"` 133 // ARN of the cluster in which this routing control will reside. 134 ClusterArn *string `pulumi:"clusterArn"` 135 // ARN of the control panel in which this routing control will reside. 136 ControlPanelArn *string `pulumi:"controlPanelArn"` 137 // The name describing the routing control. 138 // 139 // The following arguments are optional: 140 Name *string `pulumi:"name"` 141 // Status of routing control. `PENDING` when it is being created/updated, `PENDING_DELETION` when it is being deleted, and `DEPLOYED` otherwise. 142 Status *string `pulumi:"status"` 143 } 144 145 type RoutingControlState struct { 146 // ARN of the routing control. 147 Arn pulumi.StringPtrInput 148 // ARN of the cluster in which this routing control will reside. 149 ClusterArn pulumi.StringPtrInput 150 // ARN of the control panel in which this routing control will reside. 151 ControlPanelArn pulumi.StringPtrInput 152 // The name describing the routing control. 153 // 154 // The following arguments are optional: 155 Name pulumi.StringPtrInput 156 // Status of routing control. `PENDING` when it is being created/updated, `PENDING_DELETION` when it is being deleted, and `DEPLOYED` otherwise. 157 Status pulumi.StringPtrInput 158 } 159 160 func (RoutingControlState) ElementType() reflect.Type { 161 return reflect.TypeOf((*routingControlState)(nil)).Elem() 162 } 163 164 type routingControlArgs struct { 165 // ARN of the cluster in which this routing control will reside. 166 ClusterArn string `pulumi:"clusterArn"` 167 // ARN of the control panel in which this routing control will reside. 168 ControlPanelArn *string `pulumi:"controlPanelArn"` 169 // The name describing the routing control. 170 // 171 // The following arguments are optional: 172 Name *string `pulumi:"name"` 173 } 174 175 // The set of arguments for constructing a RoutingControl resource. 176 type RoutingControlArgs struct { 177 // ARN of the cluster in which this routing control will reside. 178 ClusterArn pulumi.StringInput 179 // ARN of the control panel in which this routing control will reside. 180 ControlPanelArn pulumi.StringPtrInput 181 // The name describing the routing control. 182 // 183 // The following arguments are optional: 184 Name pulumi.StringPtrInput 185 } 186 187 func (RoutingControlArgs) ElementType() reflect.Type { 188 return reflect.TypeOf((*routingControlArgs)(nil)).Elem() 189 } 190 191 type RoutingControlInput interface { 192 pulumi.Input 193 194 ToRoutingControlOutput() RoutingControlOutput 195 ToRoutingControlOutputWithContext(ctx context.Context) RoutingControlOutput 196 } 197 198 func (*RoutingControl) ElementType() reflect.Type { 199 return reflect.TypeOf((**RoutingControl)(nil)).Elem() 200 } 201 202 func (i *RoutingControl) ToRoutingControlOutput() RoutingControlOutput { 203 return i.ToRoutingControlOutputWithContext(context.Background()) 204 } 205 206 func (i *RoutingControl) ToRoutingControlOutputWithContext(ctx context.Context) RoutingControlOutput { 207 return pulumi.ToOutputWithContext(ctx, i).(RoutingControlOutput) 208 } 209 210 // RoutingControlArrayInput is an input type that accepts RoutingControlArray and RoutingControlArrayOutput values. 211 // You can construct a concrete instance of `RoutingControlArrayInput` via: 212 // 213 // RoutingControlArray{ RoutingControlArgs{...} } 214 type RoutingControlArrayInput interface { 215 pulumi.Input 216 217 ToRoutingControlArrayOutput() RoutingControlArrayOutput 218 ToRoutingControlArrayOutputWithContext(context.Context) RoutingControlArrayOutput 219 } 220 221 type RoutingControlArray []RoutingControlInput 222 223 func (RoutingControlArray) ElementType() reflect.Type { 224 return reflect.TypeOf((*[]*RoutingControl)(nil)).Elem() 225 } 226 227 func (i RoutingControlArray) ToRoutingControlArrayOutput() RoutingControlArrayOutput { 228 return i.ToRoutingControlArrayOutputWithContext(context.Background()) 229 } 230 231 func (i RoutingControlArray) ToRoutingControlArrayOutputWithContext(ctx context.Context) RoutingControlArrayOutput { 232 return pulumi.ToOutputWithContext(ctx, i).(RoutingControlArrayOutput) 233 } 234 235 // RoutingControlMapInput is an input type that accepts RoutingControlMap and RoutingControlMapOutput values. 236 // You can construct a concrete instance of `RoutingControlMapInput` via: 237 // 238 // RoutingControlMap{ "key": RoutingControlArgs{...} } 239 type RoutingControlMapInput interface { 240 pulumi.Input 241 242 ToRoutingControlMapOutput() RoutingControlMapOutput 243 ToRoutingControlMapOutputWithContext(context.Context) RoutingControlMapOutput 244 } 245 246 type RoutingControlMap map[string]RoutingControlInput 247 248 func (RoutingControlMap) ElementType() reflect.Type { 249 return reflect.TypeOf((*map[string]*RoutingControl)(nil)).Elem() 250 } 251 252 func (i RoutingControlMap) ToRoutingControlMapOutput() RoutingControlMapOutput { 253 return i.ToRoutingControlMapOutputWithContext(context.Background()) 254 } 255 256 func (i RoutingControlMap) ToRoutingControlMapOutputWithContext(ctx context.Context) RoutingControlMapOutput { 257 return pulumi.ToOutputWithContext(ctx, i).(RoutingControlMapOutput) 258 } 259 260 type RoutingControlOutput struct{ *pulumi.OutputState } 261 262 func (RoutingControlOutput) ElementType() reflect.Type { 263 return reflect.TypeOf((**RoutingControl)(nil)).Elem() 264 } 265 266 func (o RoutingControlOutput) ToRoutingControlOutput() RoutingControlOutput { 267 return o 268 } 269 270 func (o RoutingControlOutput) ToRoutingControlOutputWithContext(ctx context.Context) RoutingControlOutput { 271 return o 272 } 273 274 // ARN of the routing control. 275 func (o RoutingControlOutput) Arn() pulumi.StringOutput { 276 return o.ApplyT(func(v *RoutingControl) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 277 } 278 279 // ARN of the cluster in which this routing control will reside. 280 func (o RoutingControlOutput) ClusterArn() pulumi.StringOutput { 281 return o.ApplyT(func(v *RoutingControl) pulumi.StringOutput { return v.ClusterArn }).(pulumi.StringOutput) 282 } 283 284 // ARN of the control panel in which this routing control will reside. 285 func (o RoutingControlOutput) ControlPanelArn() pulumi.StringOutput { 286 return o.ApplyT(func(v *RoutingControl) pulumi.StringOutput { return v.ControlPanelArn }).(pulumi.StringOutput) 287 } 288 289 // The name describing the routing control. 290 // 291 // The following arguments are optional: 292 func (o RoutingControlOutput) Name() pulumi.StringOutput { 293 return o.ApplyT(func(v *RoutingControl) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) 294 } 295 296 // Status of routing control. `PENDING` when it is being created/updated, `PENDING_DELETION` when it is being deleted, and `DEPLOYED` otherwise. 297 func (o RoutingControlOutput) Status() pulumi.StringOutput { 298 return o.ApplyT(func(v *RoutingControl) pulumi.StringOutput { return v.Status }).(pulumi.StringOutput) 299 } 300 301 type RoutingControlArrayOutput struct{ *pulumi.OutputState } 302 303 func (RoutingControlArrayOutput) ElementType() reflect.Type { 304 return reflect.TypeOf((*[]*RoutingControl)(nil)).Elem() 305 } 306 307 func (o RoutingControlArrayOutput) ToRoutingControlArrayOutput() RoutingControlArrayOutput { 308 return o 309 } 310 311 func (o RoutingControlArrayOutput) ToRoutingControlArrayOutputWithContext(ctx context.Context) RoutingControlArrayOutput { 312 return o 313 } 314 315 func (o RoutingControlArrayOutput) Index(i pulumi.IntInput) RoutingControlOutput { 316 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *RoutingControl { 317 return vs[0].([]*RoutingControl)[vs[1].(int)] 318 }).(RoutingControlOutput) 319 } 320 321 type RoutingControlMapOutput struct{ *pulumi.OutputState } 322 323 func (RoutingControlMapOutput) ElementType() reflect.Type { 324 return reflect.TypeOf((*map[string]*RoutingControl)(nil)).Elem() 325 } 326 327 func (o RoutingControlMapOutput) ToRoutingControlMapOutput() RoutingControlMapOutput { 328 return o 329 } 330 331 func (o RoutingControlMapOutput) ToRoutingControlMapOutputWithContext(ctx context.Context) RoutingControlMapOutput { 332 return o 333 } 334 335 func (o RoutingControlMapOutput) MapIndex(k pulumi.StringInput) RoutingControlOutput { 336 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *RoutingControl { 337 return vs[0].(map[string]*RoutingControl)[vs[1].(string)] 338 }).(RoutingControlOutput) 339 } 340 341 func init() { 342 pulumi.RegisterInputType(reflect.TypeOf((*RoutingControlInput)(nil)).Elem(), &RoutingControl{}) 343 pulumi.RegisterInputType(reflect.TypeOf((*RoutingControlArrayInput)(nil)).Elem(), RoutingControlArray{}) 344 pulumi.RegisterInputType(reflect.TypeOf((*RoutingControlMapInput)(nil)).Elem(), RoutingControlMap{}) 345 pulumi.RegisterOutputType(RoutingControlOutput{}) 346 pulumi.RegisterOutputType(RoutingControlArrayOutput{}) 347 pulumi.RegisterOutputType(RoutingControlMapOutput{}) 348 }