-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
Read more default envvars for GCP #6114
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,17 +39,28 @@ The following keys can be used to configure the provider. | |
retrieving this file are below. Credentials may be blank if you are running | ||
Terraform from a GCE instance with a properly-configured [Compute Engine | ||
Service Account](https://cloud.google.com/compute/docs/authentication). This | ||
can also be specified with the `GOOGLE_CREDENTIALS` or `GOOGLE_CLOUD_KEYFILE_JSON` | ||
shell environment variable, containing the contents of the credentials file. | ||
can also be specified using any of the following environment variables | ||
(listed in order of precedence): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you point to the docs where you found these requirements here? It will make it clearer why Terraform allows you to configure your credentials so many different ways. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, darn, oh well. I guess adding those would just make it more confusing. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yea, (other cloud) had this problem and eventually someone made an authoritative decision and said "these are the envvars, everything else is wrong!" 😄 |
||
|
||
* `GOOGLE_CREDENTIALS` | ||
* `GOOGLE_CLOUD_KEYFILE_JSON` | ||
* `GCLOUD_KEYFILE_JSON` | ||
|
||
* `project` - (Required) The ID of the project to apply any resources to. This | ||
can be specified using any of the following environment variables (listed in | ||
order of precedence): | ||
|
||
* `GOOGLE_PROJECT` | ||
* `GCLOUD_PROJECT` | ||
* `CLOUDSDK_CORE_PROJECT` | ||
|
||
* `region` - (Required) The region to operate under. This can also be specified | ||
with the `GOOGLE_REGION` shell environment variable. | ||
using any of the following environment variables (listed in order of | ||
precedence): | ||
|
||
* `project` - (Optional) The ID of the project to apply resources in. This | ||
can also be specified with the `GOOGLE_PROJECT` shell environment variable. | ||
If unspecified, users will need to specify the `project` attribute for | ||
all resources. If specified, resources which do not depend on a project will | ||
ignore this value. | ||
* `GOOGLE_REGION` | ||
* `GCLOUD_REGION` | ||
* `CLOUDSDK_COMPUTE_REGION` | ||
|
||
The following keys are supported for backwards compatibility, and may be | ||
removed in a future version: | ||
|
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.
what is the difference between
projs
&creds
? can't we set a global constant for this?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.
Hey @stack72
We could make this a constant and share it between the provider and provider_test, but that wasn't a pattern I saw elsewhere in the codebase and didn't want to introduce a new paradigm. This is just the test file searching for the place to pull in creds from, and it arguably could remain unchanged.
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.
Makes sense not to break the formulae :)