IaC Bazaar
Google CloudPlan-validated

Cloud Storage Bucket

Hardened GCS bucket with uniform access, versioning, lifecycle/soft-delete policies, CMEK and least-privilege IAM.

terraformGCP#gcp

Compare Object Storage across clouds →

gcp-gcs-bucketterraform v1.7

Verification

Plan-validated

Passed: 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 rejects allUsers / allAuthenticatedUsers IAM 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.cryptoKeyEncrypterDecrypter on the key before enabling, or bucket creation fails.
  • Retention lock: retention_policy.is_locked = true is 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 member values 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