Skip to content

docs(object-storage): Scope bucket policy examples by org condition - #304

Open
thedriftofwords wants to merge 5 commits into
mainfrom
cg/DOCS-2126-scope-bucket-policy-examples
Open

docs(object-storage): Scope bucket policy examples by org condition#304
thedriftofwords wants to merge 5 commits into
mainfrom
cg/DOCS-2126-scope-bucket-policy-examples

Conversation

@thedriftofwords

@thedriftofwords thedriftofwords commented Apr 27, 2026

Copy link
Copy Markdown

Summary

  • Updates Object Storage bucket policy Terraform examples to use one console user (CW) and one SAML group (AWS) as named principals, aligned with the merged docs PR coreweave/docs#3044.
  • Keeps cw:PrincipalOrgID in each example as an extra safety measure.
  • Replaces the broad arn:aws:s3:::* data source example with bucket-specific bucket and object ARNs.
  • Declares coreweave/coreweave as the provider source in each independently copyable example and regenerates the provider reference docs.

Rationale

The earlier draft used "CW": ["*"]. In HCL, the square brackets are list syntax for the principal map, but * as the identifier is not the correct org-scoped wildcard form. The docs now use named principal ARNs for generic examples and reserve bare "Principal": "*" for explicit org-wide patterns with cw:PrincipalOrgID.

Each example is a standalone root module when copied from the generated reference documentation, so declaring coreweave/coreweave once per example makes it directly initializable without duplicating the declaration for every resource.

Test plan

  • Run terraform fmt on the updated example files
  • Run make -f GNUmakefile generate
  • Run go test ./coreweave/object_storage
  • Run git diff --check
  • Run terraform init -backend=false and terraform validate for both updated examples.
  • Confirm terraform plan -refresh=false reaches provider configuration for both examples. It stops as expected without a CoreWeave API token; no remote resources are created.

Additional validation with documentation example harness

To increase confidence before merge, the changes in this PR were also validated with a credential-free documentation example harness developed on branch cg/DOCS-3002-terraform-example-harness (DOCS-3002). That branch is based on this PR and is not part of this merge scope.

The harness copies each registered example into a temporary directory so no .terraform/ or lockfiles are written under examples/, then runs:

  1. terraform fmt -check
  2. terraform init -backend=false -input=false
  3. terraform validate

Both modules in this PR passed:

  • examples/resources/coreweave_object_storage_bucket_policy
  • examples/data-sources/coreweave_object_storage_bucket_policy_document

The harness does not run plan or apply, so it does not require CoreWeave API credentials. It confirms that each example resolves coreweave/coreweave, initializes cleanly, and passes schema validation as an independently copyable root module.

Closes DOCS-2126

Made with Cursor

@thedriftofwords
thedriftofwords marked this pull request as ready for review April 27, 2026 18:26
@thedriftofwords
thedriftofwords requested a review from a team as a code owner April 27, 2026 18:26
sosheskaz
sosheskaz previously approved these changes Apr 28, 2026
@thedriftofwords

thedriftofwords commented Apr 28, 2026

Copy link
Copy Markdown
Author

Working through manual testing, will merge after.

7/30/26 update: Used agent-assisted testing harness for docs examples as described above in PR description; harness used locally to test this PR, and will be added in a subsequent PR after this one is merged.

@thedriftofwords
thedriftofwords marked this pull request as draft April 28, 2026 17:17
@thedriftofwords
thedriftofwords force-pushed the cg/DOCS-2126-scope-bucket-policy-examples branch from 8f847d7 to 13b5ebc Compare July 30, 2026 16:03
thedriftofwords and others added 2 commits July 30, 2026 12:17
Declare the CoreWeave provider source so copied examples resolve the correct provider and support Terraform initialization.

Co-authored-by: Cursor <cursoragent@cursor.com>
@thedriftofwords
thedriftofwords marked this pull request as ready for review July 30, 2026 17:14
@thedriftofwords
thedriftofwords requested a review from a team as a code owner July 30, 2026 17:14
dfinster
dfinster previously approved these changes Jul 31, 2026
dfinster and others added 2 commits July 31, 2026 11:19
Replace org-wide CW wildcard principals with one console user and one SAML group ARN, keeping cw:PrincipalOrgID as an extra safety measure.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

3 participants