-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ecr): add option to auto delete images upon ECR repository removal #24572
Conversation
…inesis event source to be able to validate the eventId is created and defined at time of binding
There was a problem hiding this 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.
✅ Updated pull request passes all PRLinter validations. Dissmissing previous PRLinter review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some small feedback, otherwise this looks pretty good.
packages/@aws-cdk/aws-ecr/lib/auto-delete-images-handler/index.ts
Outdated
Show resolved
Hide resolved
…al. Updates based on PR review
Pull request has been modified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a small convention change, otherwise I think we are good.
Co-authored-by: Mitchell Valine <mitchellvaline@gmail.com>
Pull request has been modified.
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 CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
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). |
…al (aws#24572) This request fixes the ECR Repository resource to allow setting a flag on the resource to auto delete the images in the repository. This is similar to the way S3 handles the autoDeleteObjects attribute. This code base starts from a stalled PR [aws#15932](aws#15932). This also takes into account the functionality added into S3 to create tag to not delete images if the flag is flipped from true to false. Closes [aws#12618](aws#12618) References closed and not merged PR [aws#15932](aws#15932) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
…r us (#476) AWS Image Builder [recently introduced lifecycle rules](https://aws.amazon.com/about-aws/whats-new/2023/11/ec2-image-builder-lifecycle-management-deletion/) that can help us remove old images from EC2/ECR, and their descriptors on AWS Image Builder side. CDK [added automatic deletion of images in repositories](aws/aws-cdk#24572) so they can be deleted in CloudFormation easily. We had a custom resource to delete images, but now we can just use `autoDeleteImages`. We still have to clean-up AWS Image Builder image descriptors and AMIs with a custom resource. We do this so removing our construct won't leave anything behind. Resolves #471 BREAKING CHANGE: CDK 2.110.0 and above is required
… construct (#28233) Added `emptyOnDelete` prop to the ecr `Repository` construct. `emptyOndelete` is supported by CloudFormation See here: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-emptyondelete I've also deprecated the `autoDeleteImages` prop that deployed a custom resource. According to #24572 this was added before CloudFormation added the `EmptyOnDelete` property here aws-cloudformation/cloudformation-coverage-roadmap#515 Closes #28196 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
This request fixes the ECR Repository resource to allow setting a flag on the resource to auto delete the images in the repository. This is similar to the way S3 handles the autoDeleteObjects attribute. This code base starts from a stalled PR #15932. This also takes into account the functionality added into S3 to create tag to not delete images if the flag is flipped from true to false.
Closes #12618
References closed and not merged PR #15932
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license