-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
cfn-parse.ts: parseDeletionPolicy is missing CreateExceptOnDelete #26863
Comments
This would only come into play if you're using the |
Not sure if that's the only case where it would happen, but it looks like that is what we are doing in this case. |
…6880) > Describe the reason for this change, what the solution is, and any CFN recently added support for a new [deletion policy called RetainExceptOnCreate](https://aws.amazon.com/about-aws/whats-new/2023/07/aws-cloudformation-deletion-policies-dev-test-cycle/). This policy was added to the removal-policy enum in [e0d5ca](e0d5cad), however it is missing from the [switch/case block in parseDeletionPolicy](https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/core/lib/helpers-internal/cfn-parse.ts#L468), which causes errors when this removal policy is used. Closes #26863. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
Describe the bug
CFN recently added support for a new deletion policy called RetainExceptOnCreate. This policy was added to the removal-policy enum in e0d5ca, however it is missing from the switch/case block in
parseDeletionPolicy
, which causes errors when this removal policy is used.EDIT: It looks like this code may only be executed when using
CfnInclude
to create a stack from an existing CloudFormation template. Updating the rest of this issue to be more clear about that.Expected Behavior
You should be able to use
CfnInclude
to import an existing cloudformation template with valid usage ofDeletionPolicy: RetainExceptOnCreate
without any errorsCurrent Behavior
If you define a stack resource with
DeletionPolicy: RetainExceptOnCreate
, then useCfnInclude
to import that stack you'll get this error:Reproduction Steps
DeletionPolicy: RetainExceptOnCreate
CfnInclude
Possible Solution
RetainExceptOnCreate
deletionPolicy
andupdateReplacePolicy
. It looks like the newRetainExceptOnCreate
policy is not a validupdateReplacePolicy
. There will need to be two separate parsing functions.Additional Information/Context
No response
CDK CLI Version
2.91.0
Framework Version
No response
Node.js Version
v14.21.3
OS
AL2
Language
Typescript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: