-
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
(ecr): add option to auto delete images upon ECR repository removal #12618
Comments
* use native jest API like what #12596 did * move `removal policy is "Retain" by default` & `'grant adds appropriate resource-*'` tests out of `events` scope in `repository.test.ts`, which I believe they were misplaced I'm doing this partially because I would like to implement the feature proposed in #12618. It would be easier to mock `aws-sdk` function calls with jest. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
* use native jest API like what aws#12596 did * move `removal policy is "Retain" by default` & `'grant adds appropriate resource-*'` tests out of `events` scope in `repository.test.ts`, which I believe they were misplaced I'm doing this partially because I would like to implement the feature proposed in aws#12618. It would be easier to mock `aws-sdk` function calls with jest. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
hey @kirintwn, would you be interested in publishing this as a separate module? There definitely is a need and it would be a good way to get some users testing it before merging into the CDK. It may be possible to extend the existing ecr.Repository class and intercept this prop and then create the custom resource. |
@kirintwn any chance we can publish your branch if it's fully working ? we need this feature terribly. |
@MrArnoldPalmer is there anyway the CDK team can help on publishing this feature ? |
* use native jest API like what aws#12596 did * move `removal policy is "Retain" by default` & `'grant adds appropriate resource-*'` tests out of `events` scope in `repository.test.ts`, which I believe they were misplaced I'm doing this partially because I would like to implement the feature proposed in aws#12618. It would be easier to mock `aws-sdk` function calls with jest. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Any update or workaround for this? |
do we have any updates on this feature? |
This would be very nice. Constantly running into issues because of lack of this. |
We would really appreciate such an option! |
We really need this feature as well, would be a huge help |
please add this feature |
indeed, please add. |
To whoever ends up implementing this, be mindful of this issue: #16603 We don't want to end up with the same problem. |
This issue has received a significant amount of attention so we are automatically upgrading its priority. A member of the community will see the re-prioritization and provide an update on the issue. |
…al (#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 [#15932](#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](#12618) References closed and not merged PR [#15932](#15932) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
Tested this feature this morning with cdk 2.70.0. I am still seeing the error
|
…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*
This is now supported by CloudFormation Do we still need this custom resource? |
Use Case
ECR repositories currently do not get delete if they contain images even the
removalPolicy
is set toDESTROY
.It was reported in #2765, and was thought to be a responsibility of CloudFormation team aws-cloudformation/cloudformation-coverage-roadmap#515.
Proposed Solution
I do think we should add a option to force delete the images using custom resource provider, which is just like #12090 that uses a custom resource provider to delete objects in s3.
The code might looks like this:
The props
autoDeleteImages
can only to be true ifremovalPolicy
is set toDESTROY
.Other
This is a 🚀 Feature Request
The text was updated successfully, but these errors were encountered: