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 of DeletionPolicy: RetainExceptOnCreate without any errors
Current Behavior
If you define a stack resource with DeletionPolicy: RetainExceptOnCreate, then use CfnInclude to import that stack you'll get this error:
Error: Unrecognized DeletionPolicy 'RetainExceptOnCreate'
Reproduction Steps
- Create Cloudformation template with a stack resource with
DeletionPolicy: RetainExceptOnCreate
- Import that template as a cdk stack using
CfnInclude
Possible Solution
- Add a case for
RetainExceptOnCreate
- It looks like cfn-parse uses this same parsing function for both
deletionPolicy and updateReplacePolicy. It looks like the new RetainExceptOnCreate policy is not a valid updateReplacePolicy. 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
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
CfnIncludeto 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
CfnIncludeto import an existing cloudformation template with valid usage ofDeletionPolicy: RetainExceptOnCreatewithout any errorsCurrent Behavior
If you define a stack resource with
DeletionPolicy: RetainExceptOnCreate, then useCfnIncludeto import that stack you'll get this error:Reproduction Steps
DeletionPolicy: RetainExceptOnCreateCfnIncludePossible Solution
RetainExceptOnCreatedeletionPolicyandupdateReplacePolicy. It looks like the newRetainExceptOnCreatepolicy 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