cloudbeat
cloudbeat copied to clipboard
[Create Environment] Fix Undeleted EBS Snapshots
Based on the issue #8365, we found out that some environment creations were leaving undeleted EBS Snapshots behind.
The cases:
- Failed creations
- Environments with flag
Cleanup resources after provision
true - Environment is created successfully but everything
Delete Environment
is used before CNVM cycle is done.
We need to find a way to prevent undeleted EBS Snapshots (And delete current backlog).
Suggestions:
- Implement grace shutdown in cloudbeat, which deletes even if a context cancel is signaled
- On environment creation, "pass" a unique key as configuration to Cloudbeat, which then will be used to tag all the created snapshots. Then, on GH, once the environment is being cleaned up, delete the snapshots with the unique "deployment" identifier.
- Note: Pass is between quotes because maybe there is a unique deployment id already available