Menu

1 / 2

Storing Terraform State in Google Cloud Storage

DEV Community·Abraham Naiborhu·6 months ago
#yD0wfTTK
#terraform#googlecloud#state#enter#article
Reading 0:00
15s threshold

Again with another journey of mine!

In my previous Terraform labs, I created Google Cloud resources using Terraform with local state. By default, Terraform stores state locally in a file called:

terraform.tfstate

Enter fullscreen mode

Exit fullscreen mode

Previously, we are doing this locally, and now i want to try it in GCS (google cloud storage) to store my remote state.

In this article, I will move from local Terraform state to remote state using Google Cloud Storage. Thus, my goal is to use the remote state using Google Cloud Storage.

What This Lab Creates

We will create:

a Google Cloud Storage bucket for Terraform state

a Terraform GCS backend configuration

a custom VPC network

a custom subnet

a remote Terraform state file stored in GCS

My state bucket name is:

terraform-gcp-learning-lab-terraform-state

Enter fullscreen mode

Exit fullscreen mode

The state path in the bucket…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.