Skip to content

feat(core): new RemovalPolicy.RETAIN_EXCEPT_ON_CREATE to only retain resources that have been successfully created#26602

Merged
mergify[bot] merged 5 commits intomainfrom
mrgrain/feat/retain-existing
Aug 3, 2023
Merged

feat(core): new RemovalPolicy.RETAIN_EXCEPT_ON_CREATE to only retain resources that have been successfully created#26602
mergify[bot] merged 5 commits intomainfrom
mrgrain/feat/retain-existing

Conversation

@mrgrain
Copy link
Copy Markdown
Contributor

@mrgrain mrgrain commented Aug 2, 2023

Adds support for the RetainExceptOnCreate DeletionPolicy.
When applyToUpdateReplacePolicy is set, this uses the 'Retain' UpdateReplacePolicy.

https://aws.amazon.com/about-aws/whats-new/2023/07/aws-cloudformation-deletion-policies-dev-test-cycle/
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options

Closes #26570

Replaces #26595


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@github-actions github-actions bot added feature-request A feature should be added or improved. p1 labels Aug 2, 2023
@aws-cdk-automation aws-cdk-automation requested a review from a team August 2, 2023 09:36
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Aug 2, 2023
Copy link
Copy Markdown
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.

A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.

@mrgrain mrgrain added pr-linter/exempt-readme The PR linter will not require README changes pr-linter/exempt-integ-test The PR linter will not require integ test changes labels Aug 2, 2023
@mrgrain
Copy link
Copy Markdown
Contributor Author

mrgrain commented Aug 2, 2023

This is documented in code.
Can't integration test this was it would require a sequenced deployment, rollback and then a check. We can't do this at the moment.

@aws-cdk-automation aws-cdk-automation dismissed their stale review August 2, 2023 11:18

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Aug 2, 2023
@madeline-k madeline-k added the pr/do-not-merge This PR should not be merged at this time. label Aug 2, 2023
Copy link
Copy Markdown
Contributor

@madeline-k madeline-k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding my approval, but I've added the do-not-merge label in case others want to weigh in.

@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Aug 2, 2023
Co-authored-by: Madeline Kusters <80541297+madeline-k@users.noreply.github.com>
@mrgrain mrgrain changed the title feat(core): support new RetainExceptOnCreate RemovalPolicy feat(core): support new RETAIN_EXCEPT_ON_CREATE RemovalPolicy Aug 2, 2023
@mrgrain mrgrain changed the title feat(core): support new RETAIN_EXCEPT_ON_CREATE RemovalPolicy feat(core): new RemovalPolicy.RETAIN_EXCEPT_ON_CREATE to only retain resources that have been successfully created Aug 2, 2023
@mrgrain mrgrain removed the pr/do-not-merge This PR should not be merged at this time. label Aug 3, 2023
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Aug 3, 2023

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 3bae65a
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit c84666c into main Aug 3, 2023
@mergify mergify bot deleted the mrgrain/feat/retain-existing branch August 3, 2023 09:35
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Aug 3, 2023

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contribution/core This is a PR that came from AWS. feature-request A feature should be added or improved. p1 pr-linter/exempt-integ-test The PR linter will not require integ test changes pr-linter/exempt-readme The PR linter will not require README changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

aws-cdk-lib: add RetainExceptOnCreate to RemovalPolicy enum

5 participants