Closed benswinburne closed 10 months ago
Hi @benswinburne sorry you're hitting this issue while upgrading. There was indeed a breaking change in the original 1.0 where there was a change to the layout of the subnets. You can still use the old behaviour for now by changing your import to:
import * as awsx from '@pulumi/awsx/classic';
This should be resolved once the following enhancements have been completed to allow more control over the layout:
Out of interest, what is the current layout of your deployed subnets?
Here's what I think the 1.x code is generating for you:
[
{
azName: 'us-east-1a',
cidrBlock: '10.0.0.0/19',
type: 'Private',
subnetName: 'vpcName-private-1',
}, {
azName: 'us-east-1a',
cidrBlock: '10.0.32.0/20',
type: 'Public',
subnetName: 'vpcName-public-1',
}, {
azName: 'us-east-1a',
cidrBlock: '10.0.64.0/19',
type: 'Isolated',
subnetName: 'vpcName-db-1',
}, {
azName: 'us-east-2b',
cidrBlock: '10.0.64.0/19',
type: 'Private',
subnetName: 'vpcName-private-2',
}, {
azName: 'us-east-2b',
cidrBlock: '10.0.96.0/20',
type: 'Public',
subnetName: 'vpcName-public-2',
}, {
azName: 'us-east-2b',
cidrBlock: '10.0.128.0/19',
type: 'Isolated',
subnetName: 'vpcName-db-2',
}, {
azName: 'us-east-2c',
cidrBlock: '10.0.128.0/19',
type: 'Private',
subnetName: 'vpcName-private-3',
}, {
azName: 'us-east-2c',
cidrBlock: '10.0.160.0/20',
type: 'Public',
subnetName: 'vpcName-public-3',
}, {
azName: 'us-east-2c',
cidrBlock: '10.0.192.0/19',
type: 'Isolated',
subnetName: 'vpcName-db-3',
}
]
Hi @danielrbradley
Thanks for the super quick response.
My subnet layout is not quite as you described, but similar.
That said, changing to use awsx/classic has resolved the problem for now. That has allowed me to get on my way and I'll be able to shift this infrastructure around now.
Thanks very much for your help. I'll keep an eye on #1135, too.
This is now fixed as part of #1135
There is a new subnetStrategy
field on the VPC which can be set to "Auto" rather than the default "Legacy" mode. This will create the subnets in the same order as they were defined and also allows the adding of custom reserved blocks by adding a subnet spec with type "Unused".
What happened?
I have been in the unfortunate position where I'm having to upgrade a very old Pulumi stack.
Having updated the codebase to run, everything is fine except for the subnet definitions in the VPC. Despite no changes to my code, it now breaks and I can't preview/deploy my IaC.
Given that there are no changes to the subnet definitions, presumably there should be no changes detected by Pulumi?
Are there any workarounds so I can just hardcode the original subnets in so they don't change.
Example
Install the following dependencies
"@pulumi/aws": "^3.19.2" "@pulumi/awsx": "^0.22.0" "@pulumi/pulumi": "^2.15.4"
Update dependencies to
Change VPC definition to
Observe problem.
Output of
pulumi about
Additional context
Obviously the VPC is attached to many resources including databases which are a huge rigmarole to replace, and the the VPC ID is referred to by other stacks etc so replacing the VPC would be far from ideal
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).