github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ec2transitgateway/multicastDomainAssociation.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 ec2transitgateway 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 // Associates the specified subnet and transit gateway attachment with the specified transit gateway multicast domain. 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/ec2transitgateway" 26 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 27 // 28 // ) 29 // 30 // func main() { 31 // pulumi.Run(func(ctx *pulumi.Context) error { 32 // example, err := ec2transitgateway.NewTransitGateway(ctx, "example", &ec2transitgateway.TransitGatewayArgs{ 33 // MulticastSupport: pulumi.String("enable"), 34 // }) 35 // if err != nil { 36 // return err 37 // } 38 // exampleVpcAttachment, err := ec2transitgateway.NewVpcAttachment(ctx, "example", &ec2transitgateway.VpcAttachmentArgs{ 39 // SubnetIds: pulumi.StringArray{ 40 // exampleAwsSubnet.Id, 41 // }, 42 // TransitGatewayId: example.ID(), 43 // VpcId: pulumi.Any(exampleAwsVpc.Id), 44 // }) 45 // if err != nil { 46 // return err 47 // } 48 // exampleMulticastDomain, err := ec2transitgateway.NewMulticastDomain(ctx, "example", &ec2transitgateway.MulticastDomainArgs{ 49 // TransitGatewayId: example.ID(), 50 // }) 51 // if err != nil { 52 // return err 53 // } 54 // _, err = ec2transitgateway.NewMulticastDomainAssociation(ctx, "example", &ec2transitgateway.MulticastDomainAssociationArgs{ 55 // SubnetId: pulumi.Any(exampleAwsSubnet.Id), 56 // TransitGatewayAttachmentId: exampleVpcAttachment.ID(), 57 // TransitGatewayMulticastDomainId: exampleMulticastDomain.ID(), 58 // }) 59 // if err != nil { 60 // return err 61 // } 62 // return nil 63 // }) 64 // } 65 // 66 // ``` 67 // <!--End PulumiCodeChooser --> 68 type MulticastDomainAssociation struct { 69 pulumi.CustomResourceState 70 71 // The ID of the subnet to associate with the transit gateway multicast domain. 72 SubnetId pulumi.StringOutput `pulumi:"subnetId"` 73 // The ID of the transit gateway attachment. 74 TransitGatewayAttachmentId pulumi.StringOutput `pulumi:"transitGatewayAttachmentId"` 75 // The ID of the transit gateway multicast domain. 76 TransitGatewayMulticastDomainId pulumi.StringOutput `pulumi:"transitGatewayMulticastDomainId"` 77 } 78 79 // NewMulticastDomainAssociation registers a new resource with the given unique name, arguments, and options. 80 func NewMulticastDomainAssociation(ctx *pulumi.Context, 81 name string, args *MulticastDomainAssociationArgs, opts ...pulumi.ResourceOption) (*MulticastDomainAssociation, error) { 82 if args == nil { 83 return nil, errors.New("missing one or more required arguments") 84 } 85 86 if args.SubnetId == nil { 87 return nil, errors.New("invalid value for required argument 'SubnetId'") 88 } 89 if args.TransitGatewayAttachmentId == nil { 90 return nil, errors.New("invalid value for required argument 'TransitGatewayAttachmentId'") 91 } 92 if args.TransitGatewayMulticastDomainId == nil { 93 return nil, errors.New("invalid value for required argument 'TransitGatewayMulticastDomainId'") 94 } 95 opts = internal.PkgResourceDefaultOpts(opts) 96 var resource MulticastDomainAssociation 97 err := ctx.RegisterResource("aws:ec2transitgateway/multicastDomainAssociation:MulticastDomainAssociation", name, args, &resource, opts...) 98 if err != nil { 99 return nil, err 100 } 101 return &resource, nil 102 } 103 104 // GetMulticastDomainAssociation gets an existing MulticastDomainAssociation resource's state with the given name, ID, and optional 105 // state properties that are used to uniquely qualify the lookup (nil if not required). 106 func GetMulticastDomainAssociation(ctx *pulumi.Context, 107 name string, id pulumi.IDInput, state *MulticastDomainAssociationState, opts ...pulumi.ResourceOption) (*MulticastDomainAssociation, error) { 108 var resource MulticastDomainAssociation 109 err := ctx.ReadResource("aws:ec2transitgateway/multicastDomainAssociation:MulticastDomainAssociation", name, id, state, &resource, opts...) 110 if err != nil { 111 return nil, err 112 } 113 return &resource, nil 114 } 115 116 // Input properties used for looking up and filtering MulticastDomainAssociation resources. 117 type multicastDomainAssociationState struct { 118 // The ID of the subnet to associate with the transit gateway multicast domain. 119 SubnetId *string `pulumi:"subnetId"` 120 // The ID of the transit gateway attachment. 121 TransitGatewayAttachmentId *string `pulumi:"transitGatewayAttachmentId"` 122 // The ID of the transit gateway multicast domain. 123 TransitGatewayMulticastDomainId *string `pulumi:"transitGatewayMulticastDomainId"` 124 } 125 126 type MulticastDomainAssociationState struct { 127 // The ID of the subnet to associate with the transit gateway multicast domain. 128 SubnetId pulumi.StringPtrInput 129 // The ID of the transit gateway attachment. 130 TransitGatewayAttachmentId pulumi.StringPtrInput 131 // The ID of the transit gateway multicast domain. 132 TransitGatewayMulticastDomainId pulumi.StringPtrInput 133 } 134 135 func (MulticastDomainAssociationState) ElementType() reflect.Type { 136 return reflect.TypeOf((*multicastDomainAssociationState)(nil)).Elem() 137 } 138 139 type multicastDomainAssociationArgs struct { 140 // The ID of the subnet to associate with the transit gateway multicast domain. 141 SubnetId string `pulumi:"subnetId"` 142 // The ID of the transit gateway attachment. 143 TransitGatewayAttachmentId string `pulumi:"transitGatewayAttachmentId"` 144 // The ID of the transit gateway multicast domain. 145 TransitGatewayMulticastDomainId string `pulumi:"transitGatewayMulticastDomainId"` 146 } 147 148 // The set of arguments for constructing a MulticastDomainAssociation resource. 149 type MulticastDomainAssociationArgs struct { 150 // The ID of the subnet to associate with the transit gateway multicast domain. 151 SubnetId pulumi.StringInput 152 // The ID of the transit gateway attachment. 153 TransitGatewayAttachmentId pulumi.StringInput 154 // The ID of the transit gateway multicast domain. 155 TransitGatewayMulticastDomainId pulumi.StringInput 156 } 157 158 func (MulticastDomainAssociationArgs) ElementType() reflect.Type { 159 return reflect.TypeOf((*multicastDomainAssociationArgs)(nil)).Elem() 160 } 161 162 type MulticastDomainAssociationInput interface { 163 pulumi.Input 164 165 ToMulticastDomainAssociationOutput() MulticastDomainAssociationOutput 166 ToMulticastDomainAssociationOutputWithContext(ctx context.Context) MulticastDomainAssociationOutput 167 } 168 169 func (*MulticastDomainAssociation) ElementType() reflect.Type { 170 return reflect.TypeOf((**MulticastDomainAssociation)(nil)).Elem() 171 } 172 173 func (i *MulticastDomainAssociation) ToMulticastDomainAssociationOutput() MulticastDomainAssociationOutput { 174 return i.ToMulticastDomainAssociationOutputWithContext(context.Background()) 175 } 176 177 func (i *MulticastDomainAssociation) ToMulticastDomainAssociationOutputWithContext(ctx context.Context) MulticastDomainAssociationOutput { 178 return pulumi.ToOutputWithContext(ctx, i).(MulticastDomainAssociationOutput) 179 } 180 181 // MulticastDomainAssociationArrayInput is an input type that accepts MulticastDomainAssociationArray and MulticastDomainAssociationArrayOutput values. 182 // You can construct a concrete instance of `MulticastDomainAssociationArrayInput` via: 183 // 184 // MulticastDomainAssociationArray{ MulticastDomainAssociationArgs{...} } 185 type MulticastDomainAssociationArrayInput interface { 186 pulumi.Input 187 188 ToMulticastDomainAssociationArrayOutput() MulticastDomainAssociationArrayOutput 189 ToMulticastDomainAssociationArrayOutputWithContext(context.Context) MulticastDomainAssociationArrayOutput 190 } 191 192 type MulticastDomainAssociationArray []MulticastDomainAssociationInput 193 194 func (MulticastDomainAssociationArray) ElementType() reflect.Type { 195 return reflect.TypeOf((*[]*MulticastDomainAssociation)(nil)).Elem() 196 } 197 198 func (i MulticastDomainAssociationArray) ToMulticastDomainAssociationArrayOutput() MulticastDomainAssociationArrayOutput { 199 return i.ToMulticastDomainAssociationArrayOutputWithContext(context.Background()) 200 } 201 202 func (i MulticastDomainAssociationArray) ToMulticastDomainAssociationArrayOutputWithContext(ctx context.Context) MulticastDomainAssociationArrayOutput { 203 return pulumi.ToOutputWithContext(ctx, i).(MulticastDomainAssociationArrayOutput) 204 } 205 206 // MulticastDomainAssociationMapInput is an input type that accepts MulticastDomainAssociationMap and MulticastDomainAssociationMapOutput values. 207 // You can construct a concrete instance of `MulticastDomainAssociationMapInput` via: 208 // 209 // MulticastDomainAssociationMap{ "key": MulticastDomainAssociationArgs{...} } 210 type MulticastDomainAssociationMapInput interface { 211 pulumi.Input 212 213 ToMulticastDomainAssociationMapOutput() MulticastDomainAssociationMapOutput 214 ToMulticastDomainAssociationMapOutputWithContext(context.Context) MulticastDomainAssociationMapOutput 215 } 216 217 type MulticastDomainAssociationMap map[string]MulticastDomainAssociationInput 218 219 func (MulticastDomainAssociationMap) ElementType() reflect.Type { 220 return reflect.TypeOf((*map[string]*MulticastDomainAssociation)(nil)).Elem() 221 } 222 223 func (i MulticastDomainAssociationMap) ToMulticastDomainAssociationMapOutput() MulticastDomainAssociationMapOutput { 224 return i.ToMulticastDomainAssociationMapOutputWithContext(context.Background()) 225 } 226 227 func (i MulticastDomainAssociationMap) ToMulticastDomainAssociationMapOutputWithContext(ctx context.Context) MulticastDomainAssociationMapOutput { 228 return pulumi.ToOutputWithContext(ctx, i).(MulticastDomainAssociationMapOutput) 229 } 230 231 type MulticastDomainAssociationOutput struct{ *pulumi.OutputState } 232 233 func (MulticastDomainAssociationOutput) ElementType() reflect.Type { 234 return reflect.TypeOf((**MulticastDomainAssociation)(nil)).Elem() 235 } 236 237 func (o MulticastDomainAssociationOutput) ToMulticastDomainAssociationOutput() MulticastDomainAssociationOutput { 238 return o 239 } 240 241 func (o MulticastDomainAssociationOutput) ToMulticastDomainAssociationOutputWithContext(ctx context.Context) MulticastDomainAssociationOutput { 242 return o 243 } 244 245 // The ID of the subnet to associate with the transit gateway multicast domain. 246 func (o MulticastDomainAssociationOutput) SubnetId() pulumi.StringOutput { 247 return o.ApplyT(func(v *MulticastDomainAssociation) pulumi.StringOutput { return v.SubnetId }).(pulumi.StringOutput) 248 } 249 250 // The ID of the transit gateway attachment. 251 func (o MulticastDomainAssociationOutput) TransitGatewayAttachmentId() pulumi.StringOutput { 252 return o.ApplyT(func(v *MulticastDomainAssociation) pulumi.StringOutput { return v.TransitGatewayAttachmentId }).(pulumi.StringOutput) 253 } 254 255 // The ID of the transit gateway multicast domain. 256 func (o MulticastDomainAssociationOutput) TransitGatewayMulticastDomainId() pulumi.StringOutput { 257 return o.ApplyT(func(v *MulticastDomainAssociation) pulumi.StringOutput { return v.TransitGatewayMulticastDomainId }).(pulumi.StringOutput) 258 } 259 260 type MulticastDomainAssociationArrayOutput struct{ *pulumi.OutputState } 261 262 func (MulticastDomainAssociationArrayOutput) ElementType() reflect.Type { 263 return reflect.TypeOf((*[]*MulticastDomainAssociation)(nil)).Elem() 264 } 265 266 func (o MulticastDomainAssociationArrayOutput) ToMulticastDomainAssociationArrayOutput() MulticastDomainAssociationArrayOutput { 267 return o 268 } 269 270 func (o MulticastDomainAssociationArrayOutput) ToMulticastDomainAssociationArrayOutputWithContext(ctx context.Context) MulticastDomainAssociationArrayOutput { 271 return o 272 } 273 274 func (o MulticastDomainAssociationArrayOutput) Index(i pulumi.IntInput) MulticastDomainAssociationOutput { 275 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *MulticastDomainAssociation { 276 return vs[0].([]*MulticastDomainAssociation)[vs[1].(int)] 277 }).(MulticastDomainAssociationOutput) 278 } 279 280 type MulticastDomainAssociationMapOutput struct{ *pulumi.OutputState } 281 282 func (MulticastDomainAssociationMapOutput) ElementType() reflect.Type { 283 return reflect.TypeOf((*map[string]*MulticastDomainAssociation)(nil)).Elem() 284 } 285 286 func (o MulticastDomainAssociationMapOutput) ToMulticastDomainAssociationMapOutput() MulticastDomainAssociationMapOutput { 287 return o 288 } 289 290 func (o MulticastDomainAssociationMapOutput) ToMulticastDomainAssociationMapOutputWithContext(ctx context.Context) MulticastDomainAssociationMapOutput { 291 return o 292 } 293 294 func (o MulticastDomainAssociationMapOutput) MapIndex(k pulumi.StringInput) MulticastDomainAssociationOutput { 295 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *MulticastDomainAssociation { 296 return vs[0].(map[string]*MulticastDomainAssociation)[vs[1].(string)] 297 }).(MulticastDomainAssociationOutput) 298 } 299 300 func init() { 301 pulumi.RegisterInputType(reflect.TypeOf((*MulticastDomainAssociationInput)(nil)).Elem(), &MulticastDomainAssociation{}) 302 pulumi.RegisterInputType(reflect.TypeOf((*MulticastDomainAssociationArrayInput)(nil)).Elem(), MulticastDomainAssociationArray{}) 303 pulumi.RegisterInputType(reflect.TypeOf((*MulticastDomainAssociationMapInput)(nil)).Elem(), MulticastDomainAssociationMap{}) 304 pulumi.RegisterOutputType(MulticastDomainAssociationOutput{}) 305 pulumi.RegisterOutputType(MulticastDomainAssociationArrayOutput{}) 306 pulumi.RegisterOutputType(MulticastDomainAssociationMapOutput{}) 307 }