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 clean (Checkov)
- Plan tests (mocked: validation rules · outputs)
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.0.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.0.sigstore.json \
gcp-gcs-bucket-1.0.0.tar.gz
# → Verified OK
# 4. (optional) confirm the checksum too
echo "02f66e7c696cf6c5bb1b02ea7b5213a6d9fb0d5ab84283ce70d6beeda65c1801 gcp-gcs-bucket-1.0.0.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.0"
}Needs a registry token from /account/tokens. The module itself is free; the account is what identifies you. Full setup: registry docs.
Cite it in your README
badge · attributionPaste this beside the module in the repository that uses it. The badge is rendered from this artifact's verification record, so it reads live-tested because the record says so, and the link lands on this page.
[](https://www.iac-bazaar.com/catalog/gcp-gcs-bucket?utm_source=syndication&utm_medium=readme&utm_campaign=artifact)
Terraform module 1.0.0, live-tested on IaC Bazaar: [Cloud Storage Bucket](https://www.iac-bazaar.com/catalog/gcp-gcs-bucket?utm_source=syndication&utm_medium=readme&utm_campaign=artifact)
```hcl
module "gcs_bucket" {
source = "www.iac-bazaar.com/iac-bazaar/gcp-gcs-bucket/gcp"
version = "1.0.0"
}
```Preview:
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.
A free account sees the contract of every module in the catalogue. There is no subscription and nothing to buy - the modules are free to download, and they run under Vizier.
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 need an account
The complete copy-paste usage, the full input/output reference, and operational notes are free with an account - shown here and bundled in the download. Sign in and this section fills in.
- Usage
- Inputs
- Outputs
Related modules
gcp-backup-dr
The vault and the plan are what the console shows; the association is what makes a backup exist, and a plan associated with nothing backs up nothing. Enforced retention is the setting ransomware cannot undo - no backup younger than it can be deleted by anyone - and WITHIN_PROJECT access lets a compromised owner restore everything. Resources come with the plan; 14 days enforced; org-scoped.
gcp-persistent-disk
A snapshot schedule is a resource policy, and its attachment to a disk is a separate resource, so a schedule in the console with no disks is the usual state; encryption is Google-managed unless a KMS key is given. The daily schedule created and attached or yours attached (none by name), your key when given, and the disk attached from its own side so the instance's disk list is left alone.
gcp-parallelstore
A persistent Parallelstore instance on the private services range you already allocated, because a VPC has one service networking peering and a module that made another would break the databases on it. Twelve TiB minimum in steps of four, balanced striping, one zone. SCRATCH, which loses the data on maintenance, is accepted by name; the bucket you import from is the durable copy.
gcp-snapshot-schedule
The resource policy is the schedule; a disk follows it only through a separate attachment, so a policy that reads daily-keep-30 in the console and is attached to nothing has never taken a snapshot. Takes the disks with the schedule and refuses one with none. Keeps the snapshots when the disk is deleted, because APPLY_RETENTION_POLICY lets them age out in exactly the window they are needed.
gcp-storage-transfer
delete_objects_unique_in_sink turns a backup into a mirror: an object deleted at the source is deleted at the destination on the next run, replicating the event the copy was meant to survive; and a job with no notification fails while its status stays ENABLED. Copies only, refuses mirroring and moving unless accepted, publishes every outcome to a topic, and spells out what the service agent needs.
gcp-filestore
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.