-
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
(aws-efs): EFS mount target will fail on subnet change #25099
Comments
Agree. I think we probably should not name the MountTarget ID based on its index here:
|
Perhaps based on the Subnet ID? |
Yes that might be a good idea. Per our discussion on Slack, this might need a new feature flag for the breaking changes but we welcome and appreciate your PR if any. |
Changing Logical IDs for EfsMountTarget While using the forEach, index will be added as a suffix to logical id of EfsMountTarget this is causing an error when the subnets array in the props has changed. Closes #25099 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
Describe the bug
When removing an EFS Mount point from a CDK deployment (say by defining fewer subnets than what are previously deployed), CDK will remove the correct mount point but will use the old unique Id for the deleted one if that subnet is in the middle of the subnet list. This will cause CloudFormation to fail as it tries to make a new Mount Point for the same EFS File System in the same AZ, which it can't do.
Expected Behavior
If I have a CDK construct
This will synth 3 Mount points, eg.
When I remove one of the subnets, i.e. remove subnet B
CDK synth will create 2 mount points with correct Ids
Current Behavior
If I have a CDK construct
This will synth 3 Mount points, eg.
When I remove one of the subnets, i.e. remove subnet B
CDK synth will create 2 mount points with an incorrect Id
Which is technically correct, but now CloudFormation will fail with this error:
This is because since the uniqueid of the mount target in subnetC has changed it's trying to create a new one.
Reproduction Steps
Create a CDK construct with an EFS attached to 3 subnets.
now delete subnetB.
Possible Solution
CDK needs to keep track of the subnets and mount target unique IDs somehow
Additional Information/Context
No response
CDK CLI Version
2.67.0
Framework Version
No response
Node.js Version
18.12.1
OS
Windows
Language
Typescript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: