Skip to content

Commit

Permalink
fix(core): add RetainExceptOnCreate to ParseDeletionPolicy method (aw…
Browse files Browse the repository at this point in the history
…s#26880)

> 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](aws@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 aws#26863.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
dineshkatamneni authored Aug 25, 2023
1 parent 6227c94 commit 702d9d5
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@ export class CfnParser {
case 'Delete': return CfnDeletionPolicy.DELETE;
case 'Retain': return CfnDeletionPolicy.RETAIN;
case 'Snapshot': return CfnDeletionPolicy.SNAPSHOT;
case 'RetainExceptOnCreate': return CfnDeletionPolicy.RETAIN_EXCEPT_ON_CREATE;
default: throw new Error(`Unrecognized DeletionPolicy '${policy}'`);
}
}
Expand Down

0 comments on commit 702d9d5

Please sign in to comment.