Skip to content

Commit 702d9d5

Browse files
fix(core): add RetainExceptOnCreate to ParseDeletionPolicy method (#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](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*
1 parent 6227c94 commit 702d9d5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/aws-cdk-lib/core/lib/helpers-internal/cfn-parse.ts

+1
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,7 @@ export class CfnParser {
472472
case 'Delete': return CfnDeletionPolicy.DELETE;
473473
case 'Retain': return CfnDeletionPolicy.RETAIN;
474474
case 'Snapshot': return CfnDeletionPolicy.SNAPSHOT;
475+
case 'RetainExceptOnCreate': return CfnDeletionPolicy.RETAIN_EXCEPT_ON_CREATE;
475476
default: throw new Error(`Unrecognized DeletionPolicy '${policy}'`);
476477
}
477478
}

0 commit comments

Comments
 (0)