Repository navigation
Align cluster commands with nested S3 storage access - #59
Merged
Merged
Conversation
rmorehig
marked this pull request as ready for review
September 7, 2026 18:38
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.
Cluster and database commands now use the cluster-scoped
s3_storage_accessand nesteds3_storagecontract from Platform #1482.cluster createaccepts optional--s3-storage-access-external-idand--s3-storage-access-resource-tag. The API generates omitted identity values; the CLI forwards only supplied overrides. Custom cluster storage requires an explicit External ID matching the role trust policy. List/status JSON reads the nested access object, includingnullfor legacy clusters. Database commands reuse the saved identity and accept no override. Managed cluster storage and inherited database storage retain distinct labels.Flags now mirror API field paths on both cluster and database creation:
--s3-storage-data-buckets3_storage.data.bucket--s3-storage-data-paths3_storage.data.path--s3-storage-backups-buckets3_storage.backups.bucket--s3-storage-backups-paths3_storage.backups.path--s3-storage-role-arns3_storage.role_arn--s3-storage-access-external-id(cluster only)s3_storage_access.external_id--s3-storage-access-resource-tag(cluster only)s3_storage_access.resource_tagExamples
Managed storage, with API-generated identity:
Custom cluster storage:
The creation body contains these storage fields alongside name, replicas and sizing:
{ "s3_storage_access": { "external_id": "rawtree-5b71c457-7d83-474b-9db9-6dc48a1ec042", "resource_tag": "rawtree-dc1fb78e-341d-48f8-a183-9ecea12eb41d" }, "s3_storage": { "data": { "bucket": "acme-data", "path": "" }, "backups": { "bucket": "acme-backups", "path": "" }, "role_arn": "arn:aws:iam::123456789012:role/RawTreeS3" } }Database creation sends only
s3_storage:Compatibility and validation
The prior unscoped
--external-id/--resource-tag, legacy database identity flags,--s3-external-id, and former--s3-data-*,--s3-backup-*,--s3-backups-*,--s3-role-arn,--s3-storage-external-id, and--s3-storage-resource-tagflags are rejected. Region discovery/routing from current main is retained. This is coordinated with Platform #1482 and MCP #33; no release/version bump is included.cargo test --locked: 230 tests passed; the live Platform suite is normally ignored.autoreview --mode commit --commit <snapshot-parented-to-main> --max-priority P3.autoreview --mode local --max-priority P3raised one finding about empty paths; rejected because the backend defaults omitted paths to""and accepts explicit""as the bucket root. No actionable findings remain.autoreview --mode local --max-priority P3with thermo-nuclear criteria completed clean with no findings.Note
Medium Risk
Breaking CLI flag changes and cluster/database provisioning payloads require coordinated Platform #1482 rollout; misconfigured customer S3 or IAM identity can block creates until the API rejects them.
Overview
This PR updates cluster and database creation to match Platform #1482’s nested
s3_storageand cluster-scopeds3_storage_accessAPI. New shared flags (--s3-storage-data-bucket, paths, backups bucket,--s3-storage-role-arn) build the create payload when any S3 option is set; cluster create also accepts optional--s3-storage-access-external-idand--s3-storage-access-resource-tag, forwarding only supplied values while the API generates missing identity fields.List/status/create output now surfaces storage mode (RawTree-managed vs customer-owned S3), resource tags, and external IDs; database list adds a storage column. Legacy
--s3-*and old identity flags are rejected; database commands cannot override cluster identity. Implementation is split intos3_storageandcluster_identitymodules, CLI tests move tosrc/cli/tests.rs, and new mock/live contract tests cover payloads and validation.Reviewed by Cursor Bugbot for commit 29099a2. Bugbot is set up for automated code reviews on this repo. Configure here.