Cloud Storage Bucket
Hardened GCS bucket with uniform access, versioning, lifecycle/soft-delete policies, CMEK and least-privilege IAM.
Verification
Plan-validatedPassed: module logic verified on a mocked plan — inputs, validation rules, conditional creation and outputs resolve (no real provider, no cloud).
Conformance
- Static validation (fmt · validate · tflint)
- Security scan clean (Checkov)
- Plan tests (mocked: validation rules · outputs)
Provenance
- SHA-256 checksum
- Signature (pending)
Functional
- Live test pending (no cloud run yet)
Last verified 2026-06-28 · how we verify
Documentation
gcp-gcs-bucket
Hardened GCS bucket with uniform access, versioning, lifecycle/soft-delete
policies, CMEK and least-privilege IAM. Works with Terraform and OpenTofu
(>= 1.6), Google provider >= 7.0, < 8.0.
Secure defaults:
- Uniform bucket-level access always on (no object ACLs to drift)
public_access_prevention = "enforced"— and the module rejectsallUsers/allAuthenticatedUsersIAM members at plan time- Object versioning on, paired with a default lifecycle rule keeping the 10 newest noncurrent versions and aborting stale multipart uploads after 7 days
- Soft delete at GCP's 7-day default (tunable 7-90 days, or 0 to disable)
- Optional CMEK, Autoclass, WORM retention and access logging
Requirements
- Terraform or OpenTofu
>= 1.6 hashicorp/google>= 7.0, < 8.0
Notes for integrators:
- CMEK: grant the Cloud Storage service agent
(
service-PROJECT_NUMBER@gs-project-accounts.iam.gserviceaccount.com)roles/cloudkms.cryptoKeyEncrypterDecrypteron the key before enabling, or bucket creation fails. - Retention lock:
retention_policy.is_locked = trueis irreversible — the bucket cannot be deleted until every object exceeds the retention period. - Autoclass requires
storage_class = "STANDARD"; the module enforces this at plan time. - The IAM map uses static keys, so
membervalues may be unknown at plan time (e.g. another module's service-account output).
Verification
Static-validated (fmt, validate, tflint). Live apply/destroy testing pending cloud sandbox availability — see catalog status.
License
Commercial — IaC Bazaar EULA. © IaC Bazaar. Original work (not derived from a third-party module).
Usage code & full reference unlock after purchase
The complete copy-paste usage, the full input/output reference, and operational notes ship with your licence — shown here and bundled in the download.
- Usage
- Inputs
- Outputs