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

google_bigquery_dataset_iam_member requires undocumented project parameter #6769

Closed
preston-hf opened this issue Jul 9, 2020 · 10 comments
Closed
Assignees
Labels

Comments

@preston-hf
Copy link

preston-hf commented Jul 9, 2020

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
  • If an issue is assigned to the modular-magician user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to hashibot, a community member has claimed the issue already.

Terraform Version

Affected Resource(s)

  • google_bigquery_dataset_iam_member

Problem

If project is a supported variable, it should be documented. As it seems now, you would specify the project by referencing a dataset resource's id field, which matches the example syntax. Unfortunately this doesn't work, and if you don't specify a project, you receive an error.

@ghost ghost added the bug label Jul 9, 2020
@edwardmedia edwardmedia self-assigned this Jul 9, 2020
@edwardmedia
Copy link
Contributor

edwardmedia commented Jul 9, 2020

@preston-hf I am able to run below code without adding the project. Am I missing the point you made? How can I repro your issue?

resource "google_bigquery_dataset_iam_member" "editor" {
  dataset_id = google_bigquery_dataset.dataset.dataset_id
  role       = "roles/bigquery.dataEditor"
  member     = "user:[email protected]"
}
resource "google_bigquery_dataset" "dataset" {
  dataset_id                  = "issue6769dataset"
  friendly_name               = "test"
  description                 = "This is a test description"
  location                    = "EU"
  default_table_expiration_ms = 3600000
  labels = {
    env = "default"
  }
  access {
    role          = "OWNER"
    user_by_email = google_service_account.bqowner.email
  }
  access {
    role   = "READER"
    domain = "hashicorp.com"
  }
}
resource "google_service_account" "bqowner" {
  account_id = "bqowner"
}

@preston-hf
Copy link
Author

Do you have a default project set on your provider possibly?

@ghost ghost removed the waiting-response label Jul 9, 2020
@preston-hf
Copy link
Author

I have been getting this error:

Error: project: required field is not set

Pretty standard, I get it all of the time. The main issue here is you can't specify the project a dataset is in by using the full dataset id, only the dataset name without the project. Also, the project var is totally undocumented.

@edwardmedia
Copy link
Contributor

@preston-hf can you provide the config that will fail? Thanks

@edwardmedia
Copy link
Contributor

edwardmedia commented Jul 13, 2020

@preston-hf I do have below environment variable.
GOOGLE_PROJECT=
I also tested it by providing the project explicitly in the resource configs (the env variable removed) and the behavior is the same.
Have this issue been resolved to you?

@edwardmedia
Copy link
Contributor

@preston-hf is this still an issue with you? If yes, could you please provide the config so I can repro it?

@preston-hf
Copy link
Author

The issue still exists, yes. Unfortunately I can't provide proprietary config here and I don't have more time to track this down. The quick fix would be to document that this resource accepts the project parameter.

@ghost ghost removed the waiting-response label Jul 16, 2020
@edwardmedia
Copy link
Contributor

@preston-hf Using above code, I tested the resource does accept project. I guess the issue may be caused by other reasons. Without the code, it is difficult to guess. I am closing this issue at this moment. Please feel free to reopen it if we could have code to repro it. Thanks

@preston-hf
Copy link
Author

As I said, the docs need to be updated to show that they accept a project parameter. I do understand that it accepts one, I am using it.

@ghost
Copy link

ghost commented Aug 16, 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 Aug 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants