Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update environment variable GOOGLE_CLOUD_KEYFILE_JSON #6397

Conversation

dmyerscough
Copy link
Contributor

When exporting the GOOGLE_CLOUD_KEYFILE_JSON environment variable, running a terraform init threw an error regarding credentials missing.

$ export GOOGLE_CLOUD_KEYFILE_JSON=~/Downloads/playground-s-11-2211f8-941f6dbcc691.json
 
$ terraform init
Initializing modules...
- bastion in ../../modules/core/bastion

Initializing the backend...

Error: storage.NewClient() failed: dialing: google: could not find default credentials. See https://developers.google.com/accounts/docs/application-default-credentials for more information.

However, exporting the GOOGLE_APPLICATION_CREDENTIALS environment variable allowed Terraform to find the credentials file.

$ export GOOGLE_APPLICATION_CREDENTIALS=~/Downloads/playground-s-11-2211f8-941f6dbcc691.json

$ terraform init
Initializing modules...

Initializing the backend...

Successfully configured the backend "gcs"! Terraform will automatically
use this backend unless the backend configuration changes.

Initializing provider plugins...
- Checking for available provider plugins...
- Downloading plugin for provider "google" (hashicorp/google) 3.0.0-beta.1...
- Downloading plugin for provider "google-beta" (terraform-providers/google-beta) 3.0.0-beta.1...

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.

@slevenick
Copy link
Collaborator

Hey @dmyerscough I've used this PR to create a patch against the Magic Modules repo that generates both this repo and the terraform-provider-google-beta so changes get persisted to both places:

#6397

@ghost
Copy link

ghost commented Jun 18, 2020

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!

@ghost ghost locked and limited conversation to collaborators Jun 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants