Linked Questions

Popular Questions

Terraform claims backend GCS bucket doesn't exist

Asked by At

Terraform 1.4.5 on Windows, authenticating as individual user via gcloud auth application-default login. I suddenly started getting this error a few hours whenever I do any operating involving the state file stored in a Google Cloud Storage bucket:

Error: Failed to get existing workspaces: querying Cloud Storage failed: storage: bucket doesn't exist

My backend.tf file has not changed in several months. It simply lists the GCS bucket name and prefix:

terraform {
  backend "gcs" {
    bucket = "my-bucket-name"
    prefix = "my-module-name"
  }
}

I've tried the usual fixes, such as running terraform init -reconfigure and deleting the .terraform hidden directory, but always get the same error message.

This did happen around the time there were some permission changes and cleanup tasks done by the group that manages our GCP projects. But, the bucket still exists and I have read/write access to it.

Related Questions