pulumi / pulumi-awsx

AWS infrastructure best practices in component form!
https://www.pulumi.com/docs/guides/crosswalk/aws/
Apache License 2.0
227 stars 104 forks source link

Fix VPC support for Auto subnet layout strategy #1355

Closed t0yv0 closed 3 months ago

t0yv0 commented 3 months ago

The awsx.ec2.Vpc resource supports three subnet layout strategies: Auto, Exact, and Legacy. Consider the following program that does not specify the subnet specs:

new awsx.ec2.Vpc("vpc", {
    subnetStrategy: "Auto",
});

Prior to this change, the code would implicitly use the Legacy strategy for this program even though Auto is requested. This is now fixed. The Auto strategy already supports allocating subnets without any explicit specs provided.

t0yv0 commented 3 months ago

I can try to see if actual allocation without any subnetSpecs differs between legacy and auto allocator.

t0yv0 commented 3 months ago

It looks like legacy and auto strategies are generating the same layout. I've confirmed by provisioning this program on the prod version of the provider and testing upgrading the provider with this change. It's a no-change plan:

Resources:
    34 unchanged
t0yv0 commented 3 months ago

@corymhall can I have a quick review here? This simplifies case analysis in the PR that supports using IPAM with awsx.ec2.Vpc.