github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ec2/vpcIpv6CidrBlockAssociation.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 ec2 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 a resource to associate additional IPv6 CIDR blocks with a VPC. 16 // 17 // The `ec2.VpcIpv6CidrBlockAssociation` resource allows IPv6 CIDR blocks to be added to the VPC. 18 // 19 // ## Example Usage 20 // 21 // <!--Start PulumiCodeChooser --> 22 // ```go 23 // package main 24 // 25 // import ( 26 // 27 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2" 28 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 29 // 30 // ) 31 // 32 // func main() { 33 // pulumi.Run(func(ctx *pulumi.Context) error { 34 // test, err := ec2.NewVpc(ctx, "test", &ec2.VpcArgs{ 35 // CidrBlock: pulumi.String("10.0.0.0/16"), 36 // }) 37 // if err != nil { 38 // return err 39 // } 40 // _, err = ec2.NewVpcIpv6CidrBlockAssociation(ctx, "test", &ec2.VpcIpv6CidrBlockAssociationArgs{ 41 // Ipv6IpamPoolId: pulumi.Any(testAwsVpcIpamPool.Id), 42 // VpcId: test.ID(), 43 // }) 44 // if err != nil { 45 // return err 46 // } 47 // return nil 48 // }) 49 // } 50 // 51 // ``` 52 // <!--End PulumiCodeChooser --> 53 // 54 // ## Import 55 // 56 // Using `pulumi import`, import `aws_vpc_ipv6_cidr_block_association` using the VPC CIDR Association ID. For example: 57 // 58 // ```sh 59 // $ pulumi import aws:ec2/vpcIpv6CidrBlockAssociation:VpcIpv6CidrBlockAssociation example vpc-cidr-assoc-xxxxxxxx 60 // ``` 61 type VpcIpv6CidrBlockAssociation struct { 62 pulumi.CustomResourceState 63 64 // The IPv6 CIDR block for the VPC. CIDR can be explicitly set or it can be derived from IPAM using `ipv6NetmaskLength`. This parameter is required if `ipv6NetmaskLength` is not set and the IPAM pool does not have `allocationDefaultNetmask` set. 65 Ipv6CidrBlock pulumi.StringOutput `pulumi:"ipv6CidrBlock"` 66 // The ID of an IPv6 IPAM pool you want to use for allocating this VPC's CIDR. IPAM is a VPC feature that you can use to automate your IP address management workflows including assigning, tracking, troubleshooting, and auditing IP addresses across AWS Regions and accounts. 67 Ipv6IpamPoolId pulumi.StringOutput `pulumi:"ipv6IpamPoolId"` 68 // The netmask length of the IPv6 CIDR you want to allocate to this VPC. Requires specifying a `ipv6IpamPoolId`. This parameter is optional if the IPAM pool has `allocationDefaultNetmask` set, otherwise it or `cidrBlock` are required 69 Ipv6NetmaskLength pulumi.IntPtrOutput `pulumi:"ipv6NetmaskLength"` 70 // The ID of the VPC to make the association with. 71 VpcId pulumi.StringOutput `pulumi:"vpcId"` 72 } 73 74 // NewVpcIpv6CidrBlockAssociation registers a new resource with the given unique name, arguments, and options. 75 func NewVpcIpv6CidrBlockAssociation(ctx *pulumi.Context, 76 name string, args *VpcIpv6CidrBlockAssociationArgs, opts ...pulumi.ResourceOption) (*VpcIpv6CidrBlockAssociation, error) { 77 if args == nil { 78 return nil, errors.New("missing one or more required arguments") 79 } 80 81 if args.Ipv6IpamPoolId == nil { 82 return nil, errors.New("invalid value for required argument 'Ipv6IpamPoolId'") 83 } 84 if args.VpcId == nil { 85 return nil, errors.New("invalid value for required argument 'VpcId'") 86 } 87 opts = internal.PkgResourceDefaultOpts(opts) 88 var resource VpcIpv6CidrBlockAssociation 89 err := ctx.RegisterResource("aws:ec2/vpcIpv6CidrBlockAssociation:VpcIpv6CidrBlockAssociation", name, args, &resource, opts...) 90 if err != nil { 91 return nil, err 92 } 93 return &resource, nil 94 } 95 96 // GetVpcIpv6CidrBlockAssociation gets an existing VpcIpv6CidrBlockAssociation resource's state with the given name, ID, and optional 97 // state properties that are used to uniquely qualify the lookup (nil if not required). 98 func GetVpcIpv6CidrBlockAssociation(ctx *pulumi.Context, 99 name string, id pulumi.IDInput, state *VpcIpv6CidrBlockAssociationState, opts ...pulumi.ResourceOption) (*VpcIpv6CidrBlockAssociation, error) { 100 var resource VpcIpv6CidrBlockAssociation 101 err := ctx.ReadResource("aws:ec2/vpcIpv6CidrBlockAssociation:VpcIpv6CidrBlockAssociation", name, id, state, &resource, opts...) 102 if err != nil { 103 return nil, err 104 } 105 return &resource, nil 106 } 107 108 // Input properties used for looking up and filtering VpcIpv6CidrBlockAssociation resources. 109 type vpcIpv6CidrBlockAssociationState struct { 110 // The IPv6 CIDR block for the VPC. CIDR can be explicitly set or it can be derived from IPAM using `ipv6NetmaskLength`. This parameter is required if `ipv6NetmaskLength` is not set and the IPAM pool does not have `allocationDefaultNetmask` set. 111 Ipv6CidrBlock *string `pulumi:"ipv6CidrBlock"` 112 // The ID of an IPv6 IPAM pool you want to use for allocating this VPC's CIDR. IPAM is a VPC feature that you can use to automate your IP address management workflows including assigning, tracking, troubleshooting, and auditing IP addresses across AWS Regions and accounts. 113 Ipv6IpamPoolId *string `pulumi:"ipv6IpamPoolId"` 114 // The netmask length of the IPv6 CIDR you want to allocate to this VPC. Requires specifying a `ipv6IpamPoolId`. This parameter is optional if the IPAM pool has `allocationDefaultNetmask` set, otherwise it or `cidrBlock` are required 115 Ipv6NetmaskLength *int `pulumi:"ipv6NetmaskLength"` 116 // The ID of the VPC to make the association with. 117 VpcId *string `pulumi:"vpcId"` 118 } 119 120 type VpcIpv6CidrBlockAssociationState struct { 121 // The IPv6 CIDR block for the VPC. CIDR can be explicitly set or it can be derived from IPAM using `ipv6NetmaskLength`. This parameter is required if `ipv6NetmaskLength` is not set and the IPAM pool does not have `allocationDefaultNetmask` set. 122 Ipv6CidrBlock pulumi.StringPtrInput 123 // The ID of an IPv6 IPAM pool you want to use for allocating this VPC's CIDR. IPAM is a VPC feature that you can use to automate your IP address management workflows including assigning, tracking, troubleshooting, and auditing IP addresses across AWS Regions and accounts. 124 Ipv6IpamPoolId pulumi.StringPtrInput 125 // The netmask length of the IPv6 CIDR you want to allocate to this VPC. Requires specifying a `ipv6IpamPoolId`. This parameter is optional if the IPAM pool has `allocationDefaultNetmask` set, otherwise it or `cidrBlock` are required 126 Ipv6NetmaskLength pulumi.IntPtrInput 127 // The ID of the VPC to make the association with. 128 VpcId pulumi.StringPtrInput 129 } 130 131 func (VpcIpv6CidrBlockAssociationState) ElementType() reflect.Type { 132 return reflect.TypeOf((*vpcIpv6CidrBlockAssociationState)(nil)).Elem() 133 } 134 135 type vpcIpv6CidrBlockAssociationArgs struct { 136 // The IPv6 CIDR block for the VPC. CIDR can be explicitly set or it can be derived from IPAM using `ipv6NetmaskLength`. This parameter is required if `ipv6NetmaskLength` is not set and the IPAM pool does not have `allocationDefaultNetmask` set. 137 Ipv6CidrBlock *string `pulumi:"ipv6CidrBlock"` 138 // The ID of an IPv6 IPAM pool you want to use for allocating this VPC's CIDR. IPAM is a VPC feature that you can use to automate your IP address management workflows including assigning, tracking, troubleshooting, and auditing IP addresses across AWS Regions and accounts. 139 Ipv6IpamPoolId string `pulumi:"ipv6IpamPoolId"` 140 // The netmask length of the IPv6 CIDR you want to allocate to this VPC. Requires specifying a `ipv6IpamPoolId`. This parameter is optional if the IPAM pool has `allocationDefaultNetmask` set, otherwise it or `cidrBlock` are required 141 Ipv6NetmaskLength *int `pulumi:"ipv6NetmaskLength"` 142 // The ID of the VPC to make the association with. 143 VpcId string `pulumi:"vpcId"` 144 } 145 146 // The set of arguments for constructing a VpcIpv6CidrBlockAssociation resource. 147 type VpcIpv6CidrBlockAssociationArgs struct { 148 // The IPv6 CIDR block for the VPC. CIDR can be explicitly set or it can be derived from IPAM using `ipv6NetmaskLength`. This parameter is required if `ipv6NetmaskLength` is not set and the IPAM pool does not have `allocationDefaultNetmask` set. 149 Ipv6CidrBlock pulumi.StringPtrInput 150 // The ID of an IPv6 IPAM pool you want to use for allocating this VPC's CIDR. IPAM is a VPC feature that you can use to automate your IP address management workflows including assigning, tracking, troubleshooting, and auditing IP addresses across AWS Regions and accounts. 151 Ipv6IpamPoolId pulumi.StringInput 152 // The netmask length of the IPv6 CIDR you want to allocate to this VPC. Requires specifying a `ipv6IpamPoolId`. This parameter is optional if the IPAM pool has `allocationDefaultNetmask` set, otherwise it or `cidrBlock` are required 153 Ipv6NetmaskLength pulumi.IntPtrInput 154 // The ID of the VPC to make the association with. 155 VpcId pulumi.StringInput 156 } 157 158 func (VpcIpv6CidrBlockAssociationArgs) ElementType() reflect.Type { 159 return reflect.TypeOf((*vpcIpv6CidrBlockAssociationArgs)(nil)).Elem() 160 } 161 162 type VpcIpv6CidrBlockAssociationInput interface { 163 pulumi.Input 164 165 ToVpcIpv6CidrBlockAssociationOutput() VpcIpv6CidrBlockAssociationOutput 166 ToVpcIpv6CidrBlockAssociationOutputWithContext(ctx context.Context) VpcIpv6CidrBlockAssociationOutput 167 } 168 169 func (*VpcIpv6CidrBlockAssociation) ElementType() reflect.Type { 170 return reflect.TypeOf((**VpcIpv6CidrBlockAssociation)(nil)).Elem() 171 } 172 173 func (i *VpcIpv6CidrBlockAssociation) ToVpcIpv6CidrBlockAssociationOutput() VpcIpv6CidrBlockAssociationOutput { 174 return i.ToVpcIpv6CidrBlockAssociationOutputWithContext(context.Background()) 175 } 176 177 func (i *VpcIpv6CidrBlockAssociation) ToVpcIpv6CidrBlockAssociationOutputWithContext(ctx context.Context) VpcIpv6CidrBlockAssociationOutput { 178 return pulumi.ToOutputWithContext(ctx, i).(VpcIpv6CidrBlockAssociationOutput) 179 } 180 181 // VpcIpv6CidrBlockAssociationArrayInput is an input type that accepts VpcIpv6CidrBlockAssociationArray and VpcIpv6CidrBlockAssociationArrayOutput values. 182 // You can construct a concrete instance of `VpcIpv6CidrBlockAssociationArrayInput` via: 183 // 184 // VpcIpv6CidrBlockAssociationArray{ VpcIpv6CidrBlockAssociationArgs{...} } 185 type VpcIpv6CidrBlockAssociationArrayInput interface { 186 pulumi.Input 187 188 ToVpcIpv6CidrBlockAssociationArrayOutput() VpcIpv6CidrBlockAssociationArrayOutput 189 ToVpcIpv6CidrBlockAssociationArrayOutputWithContext(context.Context) VpcIpv6CidrBlockAssociationArrayOutput 190 } 191 192 type VpcIpv6CidrBlockAssociationArray []VpcIpv6CidrBlockAssociationInput 193 194 func (VpcIpv6CidrBlockAssociationArray) ElementType() reflect.Type { 195 return reflect.TypeOf((*[]*VpcIpv6CidrBlockAssociation)(nil)).Elem() 196 } 197 198 func (i VpcIpv6CidrBlockAssociationArray) ToVpcIpv6CidrBlockAssociationArrayOutput() VpcIpv6CidrBlockAssociationArrayOutput { 199 return i.ToVpcIpv6CidrBlockAssociationArrayOutputWithContext(context.Background()) 200 } 201 202 func (i VpcIpv6CidrBlockAssociationArray) ToVpcIpv6CidrBlockAssociationArrayOutputWithContext(ctx context.Context) VpcIpv6CidrBlockAssociationArrayOutput { 203 return pulumi.ToOutputWithContext(ctx, i).(VpcIpv6CidrBlockAssociationArrayOutput) 204 } 205 206 // VpcIpv6CidrBlockAssociationMapInput is an input type that accepts VpcIpv6CidrBlockAssociationMap and VpcIpv6CidrBlockAssociationMapOutput values. 207 // You can construct a concrete instance of `VpcIpv6CidrBlockAssociationMapInput` via: 208 // 209 // VpcIpv6CidrBlockAssociationMap{ "key": VpcIpv6CidrBlockAssociationArgs{...} } 210 type VpcIpv6CidrBlockAssociationMapInput interface { 211 pulumi.Input 212 213 ToVpcIpv6CidrBlockAssociationMapOutput() VpcIpv6CidrBlockAssociationMapOutput 214 ToVpcIpv6CidrBlockAssociationMapOutputWithContext(context.Context) VpcIpv6CidrBlockAssociationMapOutput 215 } 216 217 type VpcIpv6CidrBlockAssociationMap map[string]VpcIpv6CidrBlockAssociationInput 218 219 func (VpcIpv6CidrBlockAssociationMap) ElementType() reflect.Type { 220 return reflect.TypeOf((*map[string]*VpcIpv6CidrBlockAssociation)(nil)).Elem() 221 } 222 223 func (i VpcIpv6CidrBlockAssociationMap) ToVpcIpv6CidrBlockAssociationMapOutput() VpcIpv6CidrBlockAssociationMapOutput { 224 return i.ToVpcIpv6CidrBlockAssociationMapOutputWithContext(context.Background()) 225 } 226 227 func (i VpcIpv6CidrBlockAssociationMap) ToVpcIpv6CidrBlockAssociationMapOutputWithContext(ctx context.Context) VpcIpv6CidrBlockAssociationMapOutput { 228 return pulumi.ToOutputWithContext(ctx, i).(VpcIpv6CidrBlockAssociationMapOutput) 229 } 230 231 type VpcIpv6CidrBlockAssociationOutput struct{ *pulumi.OutputState } 232 233 func (VpcIpv6CidrBlockAssociationOutput) ElementType() reflect.Type { 234 return reflect.TypeOf((**VpcIpv6CidrBlockAssociation)(nil)).Elem() 235 } 236 237 func (o VpcIpv6CidrBlockAssociationOutput) ToVpcIpv6CidrBlockAssociationOutput() VpcIpv6CidrBlockAssociationOutput { 238 return o 239 } 240 241 func (o VpcIpv6CidrBlockAssociationOutput) ToVpcIpv6CidrBlockAssociationOutputWithContext(ctx context.Context) VpcIpv6CidrBlockAssociationOutput { 242 return o 243 } 244 245 // The IPv6 CIDR block for the VPC. CIDR can be explicitly set or it can be derived from IPAM using `ipv6NetmaskLength`. This parameter is required if `ipv6NetmaskLength` is not set and the IPAM pool does not have `allocationDefaultNetmask` set. 246 func (o VpcIpv6CidrBlockAssociationOutput) Ipv6CidrBlock() pulumi.StringOutput { 247 return o.ApplyT(func(v *VpcIpv6CidrBlockAssociation) pulumi.StringOutput { return v.Ipv6CidrBlock }).(pulumi.StringOutput) 248 } 249 250 // The ID of an IPv6 IPAM pool you want to use for allocating this VPC's CIDR. IPAM is a VPC feature that you can use to automate your IP address management workflows including assigning, tracking, troubleshooting, and auditing IP addresses across AWS Regions and accounts. 251 func (o VpcIpv6CidrBlockAssociationOutput) Ipv6IpamPoolId() pulumi.StringOutput { 252 return o.ApplyT(func(v *VpcIpv6CidrBlockAssociation) pulumi.StringOutput { return v.Ipv6IpamPoolId }).(pulumi.StringOutput) 253 } 254 255 // The netmask length of the IPv6 CIDR you want to allocate to this VPC. Requires specifying a `ipv6IpamPoolId`. This parameter is optional if the IPAM pool has `allocationDefaultNetmask` set, otherwise it or `cidrBlock` are required 256 func (o VpcIpv6CidrBlockAssociationOutput) Ipv6NetmaskLength() pulumi.IntPtrOutput { 257 return o.ApplyT(func(v *VpcIpv6CidrBlockAssociation) pulumi.IntPtrOutput { return v.Ipv6NetmaskLength }).(pulumi.IntPtrOutput) 258 } 259 260 // The ID of the VPC to make the association with. 261 func (o VpcIpv6CidrBlockAssociationOutput) VpcId() pulumi.StringOutput { 262 return o.ApplyT(func(v *VpcIpv6CidrBlockAssociation) pulumi.StringOutput { return v.VpcId }).(pulumi.StringOutput) 263 } 264 265 type VpcIpv6CidrBlockAssociationArrayOutput struct{ *pulumi.OutputState } 266 267 func (VpcIpv6CidrBlockAssociationArrayOutput) ElementType() reflect.Type { 268 return reflect.TypeOf((*[]*VpcIpv6CidrBlockAssociation)(nil)).Elem() 269 } 270 271 func (o VpcIpv6CidrBlockAssociationArrayOutput) ToVpcIpv6CidrBlockAssociationArrayOutput() VpcIpv6CidrBlockAssociationArrayOutput { 272 return o 273 } 274 275 func (o VpcIpv6CidrBlockAssociationArrayOutput) ToVpcIpv6CidrBlockAssociationArrayOutputWithContext(ctx context.Context) VpcIpv6CidrBlockAssociationArrayOutput { 276 return o 277 } 278 279 func (o VpcIpv6CidrBlockAssociationArrayOutput) Index(i pulumi.IntInput) VpcIpv6CidrBlockAssociationOutput { 280 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *VpcIpv6CidrBlockAssociation { 281 return vs[0].([]*VpcIpv6CidrBlockAssociation)[vs[1].(int)] 282 }).(VpcIpv6CidrBlockAssociationOutput) 283 } 284 285 type VpcIpv6CidrBlockAssociationMapOutput struct{ *pulumi.OutputState } 286 287 func (VpcIpv6CidrBlockAssociationMapOutput) ElementType() reflect.Type { 288 return reflect.TypeOf((*map[string]*VpcIpv6CidrBlockAssociation)(nil)).Elem() 289 } 290 291 func (o VpcIpv6CidrBlockAssociationMapOutput) ToVpcIpv6CidrBlockAssociationMapOutput() VpcIpv6CidrBlockAssociationMapOutput { 292 return o 293 } 294 295 func (o VpcIpv6CidrBlockAssociationMapOutput) ToVpcIpv6CidrBlockAssociationMapOutputWithContext(ctx context.Context) VpcIpv6CidrBlockAssociationMapOutput { 296 return o 297 } 298 299 func (o VpcIpv6CidrBlockAssociationMapOutput) MapIndex(k pulumi.StringInput) VpcIpv6CidrBlockAssociationOutput { 300 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *VpcIpv6CidrBlockAssociation { 301 return vs[0].(map[string]*VpcIpv6CidrBlockAssociation)[vs[1].(string)] 302 }).(VpcIpv6CidrBlockAssociationOutput) 303 } 304 305 func init() { 306 pulumi.RegisterInputType(reflect.TypeOf((*VpcIpv6CidrBlockAssociationInput)(nil)).Elem(), &VpcIpv6CidrBlockAssociation{}) 307 pulumi.RegisterInputType(reflect.TypeOf((*VpcIpv6CidrBlockAssociationArrayInput)(nil)).Elem(), VpcIpv6CidrBlockAssociationArray{}) 308 pulumi.RegisterInputType(reflect.TypeOf((*VpcIpv6CidrBlockAssociationMapInput)(nil)).Elem(), VpcIpv6CidrBlockAssociationMap{}) 309 pulumi.RegisterOutputType(VpcIpv6CidrBlockAssociationOutput{}) 310 pulumi.RegisterOutputType(VpcIpv6CidrBlockAssociationArrayOutput{}) 311 pulumi.RegisterOutputType(VpcIpv6CidrBlockAssociationMapOutput{}) 312 }