Skip to content

fix(storage-setup): correct the OAC reuse lookup in setup-aws.sh - #15

Merged
mellowcroc merged 1 commit into
mainfrom
fix/setup-aws-oac-reuse
Aug 20, 2026
Merged

fix(storage-setup): correct the OAC reuse lookup in setup-aws.sh#15
mellowcroc merged 1 commit into
mainfrom
fix/setup-aws-oac-reuse

Conversation

@mellowcroc

Copy link
Copy Markdown
Collaborator

Found by rerunning the guided AWS setup over the existing relay-ceremony-* infrastructure during the published-kit docs pass.

list-origin-access-controls returns flattened summaries (Items[].Name at top level), but the reuse lookup filtered on Items[?OriginAccessControlConfig.Name==…] — which matches nothing, so the lookup always returned None, the script always attempted creation, and any rerun over existing infra died with OriginAccessControlAlreadyExists:

Using existing bucket relay-ceremony-058264118330-published
Using existing bucket relay-ceremony-058264118330-inbox
Creating CloudFront origin access control
aws: [ERROR]: … OriginAccessControlAlreadyExists …

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 returns None. The neighbouring distribution lookup already filters on the summary's flat Comment and is unaffected.

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.
@mellowcroc
mellowcroc merged commit c153f6c into main Aug 20, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant