fix(storage-setup): correct the OAC reuse lookup in setup-aws.sh - #15
Merged
Conversation
list-origin-access-controls returns flattened summaries whose Name is a
top-level field, but the reuse lookup filtered on
OriginAccessControlConfig.Name, which matches nothing. The query therefore
always returned None, the script always attempted create-origin-access-control,
and any rerun over existing infrastructure died with
OriginAccessControlAlreadyExists - contradicting the documented rerun-safety
('reuses the named buckets, OAC, distribution'). First runs worked, which is
why the miss went unnoticed; rerun adoption never did.
Filter on the summary's top-level Name instead. The neighbouring distribution
lookup already filters on the summary's flat Comment field and is unaffected.
Found by rerunning the guided setup over the existing relay-ceremony
infrastructure during the published-kit documentation pass on 2026-08-21.
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.
Found by rerunning the guided AWS setup over the existing
relay-ceremony-*infrastructure during the published-kit docs pass.list-origin-access-controlsreturns flattened summaries (Items[].Nameat top level), but the reuse lookup filtered onItems[?OriginAccessControlConfig.Name==…]— which matches nothing, so the lookup always returnedNone, the script always attempted creation, and any rerun over existing infra died withOriginAccessControlAlreadyExists:That contradicts AWS_SETUP.md's documented rerun-safety ("safe to rerun … reuses the named buckets, OAC, distribution"). First runs create fine — which is why the broken lookup went unnoticed; rerun adoption never worked.
One-line fix: filter on the summary's top-level
Name. Verified against the live account: the corrected query resolves the existing OAC; the as-written query returnsNone. The neighbouring distribution lookup already filters on the summary's flatCommentand is unaffected.