Cloud Storage Bucket
Hardened GCS bucket with uniform access, versioning, lifecycle/soft-delete policies, CMEK and least-privilege IAM.
Compare Object Storage across clouds →
Part of: GCP Production Landing Zone
Verification
Live-testedReally deployed to a cloud sandbox, verified against its outputs and assertions, then destroyed - with the teardown confirmed.
Conformance
- Static validation (fmt · validate · tflint)
- Security scan pending (Checkov)
- Plan test superseded by live test
Provenance
- SHA-256 checksum
- Cosign signature
Functional
- Live-tested - applied, verified, destroyed
Last verified 2026-06-30 · how we verify
Verify this download
cosign · sha-256Don't take our word for it. Every release is signed with cosign - check the bytes against our pinned public key before you trust them.
# 1. Our pinned public key - fetch once, trust out-of-band
curl -O https://www.iac-bazaar.com/cosign.pub
# 2. This module's Sigstore bundle
curl -o gcp-gcs-bucket-1.0.1.sigstore.json \
https://www.iac-bazaar.com/api/artifacts/gcp-gcs-bucket/signature
# 3. Verify the tarball you downloaded
cosign verify-blob \
--key cosign.pub \
--bundle gcp-gcs-bucket-1.0.1.sigstore.json \
gcp-gcs-bucket-1.0.1.tar.gz
# → Verified OK
# 4. (optional) confirm the checksum too
echo "9c4ae906094c95cc52fe636847fa33ba8eb3d7b5a2fd5338355b49301ab09034 gcp-gcs-bucket-1.0.1.tar.gz" | sha256sum -cUse it from the registry
terraform · opentofumodule "gcs_bucket" {
source = "www.iac-bazaar.com/iac-bazaar/gcp-gcs-bucket/gcp"
version = "1.0.1"
}Free module — Terraform/OpenTofu downloads it with no token or setup. Full setup: registry docs.
Inputs & outputs
Create a free account to read this module's contract
The declared contract — every input name, type, default and description, plus every output — is shown to signed-in accounts, not to anonymous visitors.
This module is in the Free band, and a free account sees the contract of every Free module — no subscription needed.
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).
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
Related modules
Cloud Filestore NFS Share
A managed Cloud Filestore NFS share for GKE and Compute Engine, VPC-peered with no public exposure, optional per-client export rules for least-privilege access, and deletion protection on.
AWS S3 Bucket (hardened)
Private S3 bucket with encryption, versioning, public-access block, and TLS-only policy.
Azure Storage Account (secure-by-default)
Storage account with containers/file shares, lifecycle rules, network rules, CMK encryption and private endpoint options - Azure's most-deployed resource done right.
Linode Object Storage Bucket
S3-compatible bucket with scoped access keys, versioning, lifecycle rules, and optional static-site hosting.
Object Storage Bucket
Bucket with versioning, lifecycle/auto-tiering, retention rules, replication and pre-authenticated request support.