-
-
Notifications
You must be signed in to change notification settings - Fork 956
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
Correctly Mirror Terraform GCP Auth #907
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like build is still failing. Unsure if it is because of the environment variable collision, as I didn't have time to dig in.
defaultCreds := os.Getenv("GCLOUD_SERVICE_KEY") | ||
defer os.Setenv("GCLOUD_SERVICE_KEY", defaultCreds) | ||
os.Unsetenv("GCLOUD_SERVICE_KEY") | ||
os.Setenv("GOOGLE_CREDENTIALS", defaultCreds) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might want to disable t.Parallel
for this test to avoid colliding with other tests that might expect these env vars.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good idea.
@yorinasub17 looks like the build passes now, should I merge? https://circleci.com/gh/gruntwork-io/terragrunt/3237 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Go for it!
This PR adds support for correctly mirroring the Terraform GCP authentication behavior by supporting the
GOOGLE_CREDENTIALS
environment variable. Users can either pass in the contents or path to a credentials file.