Cleanup / GC of unused and deleted module versions from S3

Currently when you hit the delete button on a module version, it removes that version from the UI but does not clean up associated files from S3.

We are automatically creating versions of our modules for pre-release testing via a policy. Over time, we’ll accumulate thousands of these pre-release versions. As they’re only useful for a short time, we would like to be able to clean them up fully using the existing delete button / API.

Having this functionality would ensure we can use this policy without creating a large bill for S3 storage of versions that are no longer needed.

Our workflow in full:

1. Create a PR to add functionality to one of our modules
2. Automatically create a version to test that module via policy e.g. 0.0.0-pre-df5abd0
3. Test the change by running a plan against some existing infra using that pre-release version
4. Merge the module change, generating a production version like 1.1.0
5. Hit the delete button or API on module version 0.0.0-pre-df5abd0

At this point, version 0.0.0-pre-df5abd0 has no further use-case, and is not applied to any resources. It’s been removed from the UI, but not from S3.

Workaround
Unclear. Deleting from S3 directly is something we could handle, but not sure if it'll break anything in Spacelift.
Problem
Problem: As we create many pre-release versions of our modules for testing via an automated policy, we'll be accumulating lots of archives in S3 that have no use. Those archives will eventually build up, costing us money for storage.

Please authenticate to join the conversation.

Upvoters
Status

✅ Completed

Board

💡 Feature Requests

Tags

Terraform registry

Date

Over 1 year ago

Subscribe to post

Get notified by email when there are changes.