Terraform-provider-google: Failed to configure remote backend "gcs"

Created on 20 Aug 2017  ·  2Comments  ·  Source: hashicorp/terraform-provider-google

Terraform Version

$ terraform --version
Terraform v0.9.6

Affected Resource(s)

terraform backend gcs

Terraform Configuration Files

terraform {
  backend "gcs" {
    bucket = "my-terraform-state"
    path   = "testing/gcp/terraform.tfstate"
  }
}

Debug Output

$ terraform init
Initializing the backend...

Error configuring the backend "gcs": Failed to configure remote backend "gcs": google: could not find default credentials. See https://developers.google.com/accounts/docs/application-default-credentials for more information.

Please update the configuration in your Terraform files to fix this error
then run this command again.

Expected Behavior

Should have created the terraform.tfstate file which was not existing inside the already existing bucket named my-terraform-state

Actual Behavior

the state file was not created.

Steps to Reproduce

  1. terraform init

Important Factoids

Using gcs as the remote backend

Most helpful comment

Doing a

$ gcloud auth application-default login

fixed the issue.

All 2 comments

Doing a

$ gcloud auth application-default login

fixed the issue.

I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

Was this page helpful?
0 / 5 - 0 ratings