I noticed the S3 bucket that I assume SST uses to ...
# sst
d
I noticed the S3 bucket that I assume SST uses to deploy, called something like
cdk-xx-assets-1234567-us-west-2
is not deleting old objects ... is there a reason why this bucket shouldn't have a lifecycle rule to remove old objects? Is there a recommendation on how to manage this bucket?
f
Hey @Dan Beaven, the bucket is mainly used to store Lambda function zip files. It is not safe to remove the files without knowing which ones are still in-use and which are orphaned. See a lengthy discussion here - https://github.com/aws/aws-cdk-rfcs/issues/64
There have been attempt by ppl in the community that runs a cron task that figures out the files that are inuse, and remove the orphan ones. Here’s a sample project https://github.com/jogold/cloudstructs/blob/master/src/toolkit-cleaner/README.md
I haven’t tried this
toolkit-cleaner
but it seems it will work if you dropped this right into ur SST app
Copy code
new ToolkitCleaner(this, 'ToolkitCleaner');
If u get a chance to try this out, lemme know how well it works 🙂
d
thank you @Frank, I will give that a try