-
-
Notifications
You must be signed in to change notification settings - Fork 47
chore: Easier way to delete snapshots for old AMIs #728
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR simplifies the deletion of snapshots for outdated AMIs by updating asset references and leveraging the AWS SDK's built-in capability to delete associated snapshots.
- Consolidated asset hash updates in JSON templates.
- Removed the manual snapshot deletion loop from the Lambda function.
- Added the "DeleteAssociatedSnapshots" flag to automate snapshot deletion.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
test/default.integ.snapshot/github-runners-test.template.json | Updated S3Key to reference the new asset hash |
test/default.integ.snapshot/github-runners-test.assets.json | Updated asset key identifiers and corresponding objectKey values |
src/image-builders/aws-image-builder/delete-resources.lambda.ts | Simplified resource deletion by removing the manual snapshot deletion loop and using DeleteAssociatedSnapshots |
Comments suppressed due to low confidence (1)
src/image-builders/aws-image-builder/delete-resources.lambda.ts:72
- Verify that the 'DeleteAssociatedSnapshots' flag is supported by the current AWS SDK version and behaves as expected to automatically remove associated snapshots.
DeleteAssociatedSnapshots: true,
@@ -9556,7 +9556,7 @@ | |||
"S3Bucket": { | |||
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" | |||
}, | |||
"S3Key": "bfba719fe2a2764d7716a472198f4f8cbe46f6ea4616cd6ba0ebf26e75954814.zip" | |||
"S3Key": "b97c8701d090be54cf447e094fd55ece7c99b860476949ee5db7ceca6eeb2f6a.zip" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider centralizing asset hash values (and thus S3Key values) to reduce duplication and ease future updates.
"S3Key": "b97c8701d090be54cf447e094fd55ece7c99b860476949ee5db7ceca6eeb2f6a.zip" | |
"S3Key": { | |
"Ref": "LambdaS3Key" | |
} |
Copilot uses AI. Check for mistakes.
Now it's at 3.806.0. |
No description provided.