-
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
aws-cdk-lib/aws-ecr: No option available in CDK to set EmptyOnDelete property for ECR repo #28196
Comments
You're right it is supported by CloudFormation. The Should be a fairly straight forward change here: https://github.com/aws/aws-cdk/blob/116b93324f5c2d961ed222c659b1b35ec71c57c7/packages/aws-cdk-lib/aws-ecr/lib/repository.ts#L701C16-L701C16 I can work on a PR |
@carlosahs it seems CDK has implemented a custom resource that can empty the repository on deletion. You can enable it with the autoDeleteImages prop. Does this work for you? I'm not sure why we have this if CloudFormation supports it, I'll have to dig deeper |
@carlosahs ,thanks for submitting this request. |
Thanks @khushail What do you recommend we do with the autoDeleteImages custom resource? It doesn't make sense for both to co-exist IMO. I can go ahead and start on the PR to add the prop 🙂 |
… 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*
|
Describe the issue
AWS CloudFormation documentation states that
AWS::ECR::Repository
resources haveEmptyOnDelete
property, but it's not possible to set such property in CDK usingRepository
construct.Is expected
EmptyOnDelete
property not to be set in CDK?Links
The text was updated successfully, but these errors were encountered: