-
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
Project ID Not Respected In google_cloudbuild_trigger #11255
Comments
I have the same problem when using google_spanner_instance: The Project ID is not respected and when the service account is from another project this project is incorrectly used by the resource. |
I have the same problem. Did anyone figure out the solution? |
I also encountered this challenge with Cloud Build triggers using Cloud Functions Version 2/Gen 2 and was pointed by a peer to the reason. |
I had the same problem. Thanks to @whmackay's suggestion I solved it by adding the google-beta provider and set the
|
I just experienced this, and it was very unintuitive. I even set Is this possible to fix in the Go code? Can we set one of these options to false to allow it to use the defined project from the resource config? terraform-provider-google/google/services/cloudbuild/resource_cloudbuild_trigger.go Lines 6038 to 6043 in 1e379a9
Here's a version of my config that had this issue. I had to add resource "google_cloudbuild_trigger" "my-trigger" {
project = "my-cloudbuild-project"
location = "global"
# ...
}
import {
id = "projects/my-cloudbuild-project/locations/global/triggers/abc123-redacted"
to = google_cloudbuild_trigger.my-trigger
} Output:
|
The Cloud Build API, along with several other Google Cloud Platform APIs, must be enabled in both the project where the service account (used to initiate API calls) resides, and the project where Cloud Build resources (e.g., triggers, builds) are created. This is expected behavior and there is noting we can/should do on the terraform provider side. |
Thanks @averbuks! |
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. |
Community Note
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 tohashibot
, a community member has claimed the issue already.Terraform Version
Affected Resource(s)
google-beta
provider and specificallygoogle_cloudbuild_trigger
Terraform Configuration Files
Debug Output
https://gist.github.com/clive-h-townsend/76517f93e88750058f3deda1bb6950e9
Expected Behavior
Create the Cloud Build Trigger.
Actual Behavior
Failed because it says the API is not enabled. The API is indeed enabled (confirmed by checking on the console). It appears that the
project=
field is not working because the error goes away when I add Cloud Build API on the service account project. But, we are looking to setup the trigger on theproject=
project.Steps to Reproduce
terraform apply
References
https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/cloudbuild_trigger#project
The text was updated successfully, but these errors were encountered: