google-cloud-platformterraformgoogle-cloud-storageterraform-provider-gcp

What is the mechanism of Terraform state locking when using Google Cloud Platform?


What is the Google Cloud Platform mechanism for locking state file when using Terraform? Something like DynamoDB on AWS...

thanks


Solution

  • Where you store the state files (defined using a backend) is distinct from where you're deploying to. They could be the same, but don't have to be. For example, you could deploy resources to Azure while storing the state file in an AWS S3 bucket.

    If you're interested in storing the state file in the Google Cloud, Terraform has a backend called gcs that includes locking. To quote the documentation:

    gcs stores the state as an object in a configurable prefix and bucket on Google Cloud Storage (GCS).