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

BigQuery: read Google Cloud env vars and don't require project_id to setup BigQuery logging #100

Open
thomas91310 opened this issue Oct 23, 2018 · 1 comment
Labels
enhancement New feature or request feature request

Comments

@thomas91310
Copy link

Terraform Version

v0.11.8

Affected Resource(s)

  • BigQuery logging

Description

The google terraform provider reads the project id with this order of precedence:

GOOGLE_PROJECT
GOOGLE_CLOUD_PROJECT
GCLOUD_PROJECT
CLOUDSDK_CORE_PROJECT

documented here

Would it be possible to make project_id (here if I'm reading this correctly) not a required parameter?

This is my suggestion:
If project_id is specified, use the value of the parameter, if not default to the precedence logic defined by the google terraform provider?

I don't have experience with the project but happy to contribute if you think this would be a good idea.

@thomas91310 thomas91310 changed the title Google BigQuery: read Google Cloud env vars and don't require project_id to setup BigQuery logging BigQuery: read Google Cloud env vars and don't require project_id to setup BigQuery logging Oct 23, 2018
@radeksimko radeksimko added the enhancement New feature or request label Jan 24, 2019
@Integralist
Copy link
Collaborator

Integralist commented Jan 26, 2023

We can use something like the following code to fix this issue...

DefaultFunc: schema.EnvDefaultFunc("GOOGLE_PROJECT", ""),

or

DefaultFunc: schema.MultiEnvDefaultFunc([]string{
  "GOOGLE_PROJECT",
  "GOOGLE_CLOUD_PROJECT",
  "GCLOUD_PROJECT",
  "CLOUDSDK_CORE_PROJECT",
}, "")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature request
Projects
None yet
Development

No branches or pull requests

3 participants