Conversation
Read the registry-issued ExternalId from bucket registration / bucket config responses and reuse it for bootstrap-role, instead of generating it ad hoc client-side. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Scope update — follow-on work added to this branchThe Athena runtime rewiring and registry-side bucket-aware S3 plumbing that was previously planned as a separate follow-on stack has been added onto this same branch rather than split out. Per-repo progress is tracked in meta/251208-add-bucket/20-actually-finish-all.md § Progress; intentionally deferred items are in 21-deferred-work.md (legacy direct-Athena cleanup, deeper CI should be re-run green against this expanded scope before re-review. See meta#84 for the combined commit request. |
Testing status (this PR)Pulled from the actual diff; see meta/21-deferred-work.md § Testing status for the project-wide picture. Tested — unit tests updated or added on this branch:
Not covered by new tests in this PR — reasoned about, not validated:
Deferred validation (not on this branch or any branch):
|
Role in the chokepoint
The bootstrap step that creates the named IAM role in the control account and installs the bucket-scoped inline policy, so that deployment#2372's narrowed templates have a role to reference. This branch also switches the bootstrap to consume the registry-issued
ExternalIdinstead of generating one client-side, and now applies the full two-principal bucket policy contract. See meta#84.What this PR completes
quiltxcommand to create/reuseQuiltDataAccessRolewith an inline policy scoped to the named bucket (quiltx/bucket.py,quiltx/tools/bucket.py).ExternalIdfrom the bucket registration / bucket config response (surfaced by enterprise#1037) and reuses it for thebootstrap-roletrust policy instead of generating one client-side. First-time registration in a new external account and repeat registration in the same external account both converge on the registry-managed value.athenaAccessRoleArn, and the final bucket/SNS policy principals are the deduped union of explicit--principalvalues,external_role_arn, and the stack-owned Athena role.external_role_arnset.configure_bucket_notificationsstill runs under bucket-owner credentials, unchanged.Reference:
proj/251208-add-bucket/10-cross-account-grants.md§role-scoped trust,proj/251208-add-bucket/20-actually-finish-all.md.How to verify
tests/test_bucket.py) cover new registration, already-registered cross-account re-bootstrap, and SNS reuse/create flows under the delegated library path.quiltxagainst a fresh data account; confirm role is created, inline policy matches the bucket scope,ExternalIdin the trust policy matches the value the registry returns, bucket registers successfully, and the resulting bucket policy names both the data-access role andQuiltAthenaAccessRole.ExternalIdand converges the bucket/SNS policies onto the two-principal shape.Risk & rollback
Coupled to enterprise#1037 (registry is now the source of truth for
ExternalIdandathenaAccessRoleArn) and deployment#2372 (named role contract). Safe to revert alone — the bootstrap is idempotent and does not delete existing roles on rollback. However, deployment#2372's generated templates expect this role to exist, and the bootstrap now expects the registry to supply the bucket-policy principals; if this PR is reverted after the upstream PRs merge, new bucket registrations will fall back to the stale single-principal shape until re-applied.