All Modules
GCPFoundation

GCS Backend

GCS bucket for Terraform state with versioning and lifecycle rules

Usage

module "gcs_backend" {
  source = "github.com/fencepencil/gcp-modules//gcs-backend"

  project_id = "<project_id>"
  bucket_name = "<bucket_name>"

  tags = var.tags
}

Inputs (4)

NameTypeDescriptionDefaultRequired
project_idstringGCP project IDyes
bucket_namestringGlobally unique bucket nameyes
locationstringGCS bucket locationUSno
versions_to_keepnumberObject versions to retain5no

Outputs (3)

NameDescription
bucket_nameName of the state bucket
bucket_urlURL of the state bucket
bucket_self_linkSelf link of the bucket

More GCP Modules

Browse our full library of GCP infrastructure modules.

View all GCP modules