-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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_dataflow_job doesn't pick up "project" variable #2068
Comments
The project is getting picked up there, I believe the way services work on the API is you must have enabled the API on the project that the service account making the request belongs to. If you can share debug logs, we can probably prove that. |
I'm experiencing the exact same issue - and in my case, the API is not enabled in the service account making the request (e.g. dedicated project/service account for terraform), but is enabled in the target project. Similarly, the project is resolving to the correct project, but the error is for the project id belonging to the project I have terraform admin running in. |
That's just how services work in GCP, I believe. I'm going to close this out, because I don't know that there's anything for us to do, and I think upstream believes this is working as intended. The fix is to enable the service on the project the service account making the request belongs to. |
I'm quite confused by that response. So, let's say I have two projects: terraform-admin & awesome-project. The service account in the terraform-admin project has access to enable/disable apis and manage infrastructure in awesome-project. When I try to create a dataflow job for awesome-project, it fails because it's trying to create the dataflow job in terraform-admin project, even though the plan resolved to use awesome-project. That is the bug I believe the OP was referring to, and the same issue I ran into. Effectively, dataflow job support in terraform doesn't work the same as all the other gcp resources do. |
Do you have logs of this happening? That would indeed be a serious bug. In reality what I think you're seeing is:
|
Ah ok - it was point #3 that you listed which I ran into. Wasn't aware it needed the API enabled in both projects. Thanks for clarifying! |
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! |
Community Note
Terraform Version
Terraform v0.11.8
Affected Resource(s)
Terraform Configuration Files
Debug Output
https://gist.github.com/MaxBinnewies/b72d781d860dda5ebd0c721c71bd048f
Panic Output
Expected Behavior
Dataflow Job to be created in project 751024901768
Actual Behavior
Terraform tries to create a Dataflow job in a different project of mine 1063229073055. This is the project that the Service account I am using belongs to. I used this Service account to create the correct project 751024901768 also through Terraform.
The error message is correct in the sense that the other project does not have the Dataflow API enabled. However, the project where it is actually supposed to go does, I can create the job manually without issue.
However, Terraform does not seem to be picking up the "project" variable and tries to create the Dataflow job in the wrong project. The same applies if I set "project" to
As you can see Terraform outputs the projectId correctly, but then without any other errors in between, throws an error for a different project, leading me to believe that this might be a bug.
Steps to Reproduce
terraform apply
Important Factoids
The used service account belongs to project 1063229073055 and has been used to create project 751024901768.
References
The text was updated successfully, but these errors were encountered: