pulumi / pulumi-aws-native

AWS Native Provider for Pulumi
Apache License 2.0
95 stars 17 forks source link

VPC `Ipv6CidrBlocks` are not immediately populated #1798

Open corymhall opened 3 weeks ago

corymhall commented 3 weeks ago

What happened?

In order to create a VPC with a Ipv6 CIDR block you have to use a separate AWS::EC2::VPCCidrBlock resource. Once the VPCCidrBlock resource is created then you are able to perform a cloudcontrol get-resource request on the Vpc resource and the ipv6CidrBlocks attribute will be populated. Unfortunately this provider cannot handle that scenario. The actual flow looks something like this:

  1. Create aws-native.ec2.Vpc
  2. Perform get-resource to populate attributes - ipv6CidrBlocks is empty
  3. Create aws-native.ec2.VpcCidrBlock
  4. Some other resource references Vpc.ipv6CidrBlocks which is empty because we don't do another get-resource on the Vpc after creating the VpcCidrBlock

Users will have to always remember to access the CidrBlock from the correct VpcCidrBlock resource.

Example

const vpc = new aws.ec2.Vpc('vpc', {
    cidrBlock,
});

const ipv6Cidr = new aws.ec2.VpcCidrBlock('ipv6Cidr', {
    vpcId: vpc.vpcId,
    amazonProvidedIpv6CidrBlock: true,
});

export const ipv6cidr = vpc.ipv6CidrBlocks; // will be empty.

Output of pulumi about

N/A

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).