$ terraform --version
Terraform v0.9.6
terraform backend gcs
terraform {
backend "gcs" {
bucket = "my-terraform-state"
path = "testing/gcp/terraform.tfstate"
}
}
$ 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.
Should have created the terraform.tfstate file which was not existing inside the already existing bucket named my-terraform-state
the state file was not created.
terraform initUsing gcs as the remote backend
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!
Most helpful comment
Doing a
fixed the issue.