fix(aws): demote prior releases' public AMIs before publishing to stay under quota#53
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 AWS caps public images at 5 per region. Each release publishes 4 public AMIs per region (arch × suite for
register-amiinap-southeast-2, and arch × suite per satellite region forcopy-amis). The previous release's 4 stay public, so the next release's publish tripsResourceLimitExceededonModifyImageAttribute.This makes prior releases' public AMIs private right before publishing the new ones, in both the home region and every mirror region.
New helper
scripts/demote-public-amis.sh <region> <keep-version>revokesGroup=alllaunch permission (and the backing snapshot's create-volume permission) from every self-owned public AMI in the region whoseVersiontag isn't the release being published.register-ami-for-release.shandcopy-ami-to-region.shboth call it immediately before their publish step.Notes:
describe-imageseventual consistency rather than hard-failing on the first read.ModifyImageAttribute,ModifySnapshotAttribute, andDescribeImages.Spec-first: documents the public/mirror lifecycle (previously unspecified) and the per-region cap requirement as
r[image.output.aws-ami-public].🤖 Generated with Claude Code