Closed markshep closed 1 year ago
BTW I'm using the aws-cdk
and node@18
Homebrew packages.
There are known issues with specifying the physical names of resources in CloudFormation: see here for more info
Assigning physical names to resources has some disadvantages in AWS CloudFormation. Most importantly, any changes to deployed resources that require a resource replacement, such as changes to a resource's properties that are immutable after creation, will fail if a resource has a physical name assigned. If you end up in that state, the only solution is to delete the AWS CloudFormation stack, then deploy the AWS CDK app again. See the AWS CloudFormation documentation for details.
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.
@peterwoodworth Subnet configurations requires a name, at least in the TypeScript lib (comments removed for brevity):
export interface SubnetConfiguration {
readonly cidrMask?: number;
readonly subnetType: SubnetType;
readonly name: string;
readonly reserved?: boolean;
readonly mapPublicIpOnLaunch?: boolean;
}
You're right, that is part of specifying the logical ID (as you would define on any other construct), and it isn't used as part of the physical resource at all. The problem remains however, that CloudFormation will opt to create the new resources before deleting the old ones in this scenario, which causes this conflict.
How is that not a problem that needs a solution? I'm not sure why this is marked as "completed".
Describe the bug
I had code to create a VPC containing a single subnet and gave it the name "PublicSubnet". When this got created the name used in the CloudFormation tree vies got expanded out to be "PublicSubnetSubnet1". So I changed my code to use a name of "" so that it would just be "Subnet1" in the CloudFormation tree view. Running
sdk diff
showed that it would do what I wanted, butcdk deploy
failed with an error which caused a rollback.Expected Behavior
That the changes as specified in the
cdk diff
output would be successfully applied.Current Behavior
This was the output from
cdk deploy
:Reproduction Steps
Run once as-is, then change the
Name
parameter to""
and run again.Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.51.1 (build 3d30cdb)
Framework Version
No response
Node.js Version
v18.12.1
OS
macOS
Language
.NET
Language Version
Using dotnet 7.0.100 with a target framework of
net6.0
Other information
No response