-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ec2: CloudFormation attempts to trigger a replacement when adding a tag to NACL #27476
Comments
Thanks for reporting, we'll look into this then get back to you |
Thank you! Will be happy to share the CloudFormation logs privately if needed :) |
This is breaking our ability to deploy / update to any existing stack that has NetworkAcl constructs to the newer aws-cdk-lib version. The update results in a create/replace of all of our CDK Diff
CFN Error
Previous working CDK version 2.91.0 |
To reproduce -
|
I'm experiencing the same thing, can't get my stack deployed. |
This PR you mentioned was first introduced in 2.94.0
export class DummyStack extends Stack {
constructor(scope: Construct, id: string, props: StackProps) {
super(scope, id, props);
// my default vpc
const vpc = getDefaultVpc(this);
const publicNacl = new ec2.NetworkAcl(this, 'PublicNacl', {
vpc,
subnetSelection: {
subnetType: SubnetType.PUBLIC,
},
});
publicNacl.addEntry('AllowSshRule-1', {
cidr: ec2.AclCidr.ipv4('8.8.8.8'),
direction: ec2.TrafficDirection.INGRESS,
ruleNumber: 1,
traffic: ec2.AclTraffic.tcpPort(22),
ruleAction: ec2.Action.ALLOW,
});
}
}
publicNacl.addEntry('AllowSshRule-1', {
cidr: ec2.AclCidr.ipv4('8.8.8.8/32'),
direction: ec2.TrafficDirection.INGRESS,
ruleNumber: 1,
traffic: ec2.AclTraffic.tcpPort(22),
ruleAction: ec2.Action.ALLOW,
networkAclEntryName: 'PublicNacl'
});
Now I destroyed the stack and repeated it again using
As we can't reproduce this issue, I am downgrading this to |
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
Describe the bug
Related to changes made in #26898 from the original issue raised in #26897
After updating aws-cdk with this change inside and with the original construct not having
networkAclName
specified, aws-cdk deploy resulted in anInternal Failure
being recorded for the deployment of the stack. This was when thenetworkAclName
was using thethis.node.path
variable in theName
tag of the NACL.Further investigation into the resources being created/destroyed seems to point to the NACL being deleted and recreated during the deployment process. The CloudFormation logs provide the following information
Requested update requires the replacement of the existing resource; deleting existing resource, then creating a new one.
for the NACL that is being tagged.I'm not sure if this forum is the right place to be raising CloudFormation specific issues, if it's not, will be happy to post this in the correct forum.
Expected Behavior
Name
tag should be added to the resource without having to re-create the resource again.Current Behavior
Requested update requires the replacement of the existing resource; deleting existing resource, then creating a new one.
UPDATE_FAILED
and a status reason ofInternal Failure
Reproduction Steps
networkAclName: 'PublicNacl',
to thepublicNacl
and use the latest aws-cdk which includes commit fix(ec2): networkAclName property for NetworkAcl does not work #26898Possible Solution
Wondering if the NACL's or the association's logical resource ID is somehow tied to the name that is used resulting in people having earlier versions of the construct to face this issue when the construct is deployed. However, aws-cdk diff does not show any difference in logical ID only that the
Name
tag needs to be addedAdditional Information/Context
Previous CDK version was 2.84.0
CDK CLI Version
2.99.1 (build b2a895e)
Framework Version
No response
Node.js Version
18.16.0
OS
Mac w/ Apple Silicon
Language
TypeScript
Language Version
4.9.5
Other information
No response
The text was updated successfully, but these errors were encountered: