Skip to content
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

Garbage Collection for Assets #590

Closed
1 of 11 tasks
mrpackethead opened this issue Dec 18, 2023 · 1 comment
Closed
1 of 11 tasks

Garbage Collection for Assets #590

mrpackethead opened this issue Dec 18, 2023 · 1 comment

Comments

@mrpackethead
Copy link
Contributor

mrpackethead commented Dec 18, 2023

This is an exact copy of issue #64 64 which was closed but is a real point of contention

Assets which are uploaded to the CDK's S3 bucket and ECR repository are never deleted. This will incur costs for users in the long term. We should come up with a story on how those should be garbage collected safely.

Initially we should offer cdk gc which will track down unused assets (e.g. by tracing them back from deployed stacks) and offering users to delete them. We can offer an option to automatically run this after every deployment (either in CLI or through CI/CD). Later we can even offer a construct that you deploy to your environment and it can do that for you.

Proposed usage:

cdk gc [ENVIRONMENT...] [--list] [--type=s3|ecr]
Examples:

This command will find all orphaned S3 and ECR assets in a specific AWS environment and will delete them:

cdk gc aws://ACCOUNT/REGION
This command will garbage collect all assets in all environments that belong to the current CDK app (if cdk.json exists):

cdk gc
Just list orphaned assets:

cdk gc --list

Description

Short description of the proposed feature.

Roles

Role User
Proposed by @alias
Author(s) @alias, @alias, @alias
API Bar Raiser @alias
Stakeholders @alias, @alias, @alias

See RFC Process for details

Workflow

  • Tracking issue created (label: status/proposed)
  • API bar raiser assigned (ping us at #aws-cdk-rfcs if needed)
  • Kick off meeting
  • RFC pull request submitted (label: status/review)
  • Community reach out (via Slack and/or Twitter)
  • API signed-off (label status/api-approved applied to pull request)
  • Final comments period (label: status/final-comments-period)
  • Approved and merged (label: status/approved)
  • Execution plan submitted (label: status/planning)
  • Plan approved and merged (label: status/implementing)
  • Implementation complete (label: status/done)

Author is responsible to progress the RFC according to this checklist, and
apply the relevant labels to this issue so that the RFC table in README gets
updated.

@mrpackethead mrpackethead added the status/proposed Newly proposed RFC label Dec 18, 2023
@evgenyka
Copy link

evgenyka commented Dec 18, 2023

We'll keep original RFC open (#64) and add it to the roadmap. Closing this one as duplicate.

@mrgrain mrgrain removed the status/proposed Newly proposed RFC label Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants