cfn-parse.ts: parseDeletionPolicy is missing CreateExceptOnDelete #26863
Labels
@aws-cdk/cloudformation-include
Issues related to the "CFN include v.20" package
@aws-cdk/core
Related to core CDK functionality
bug
This issue is a bug.
effort/small
Small work item – less than a day of effort
good first issue
Related to contributions. See CONTRIBUTING.md
p1
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: