Open verbanicm opened 1 year ago
This is a known interaction, I'm not sure if we'd want to modify the google_project
resource to enable services as proposed in https://github.com/hashicorp/terraform-provider-google/pull/14173- particularly in a minor release. Will respond in more depth when I have cycles, unblocking our release right now.
Alright, took me a bit longer to get back than expected. Sorry about that! Also fyi @c2thorn in case you have input.
There are numerous reasons we likely want to avoid making this change, in my opinion:
google_project_service
.This is caused by the list services request using the newly created project.ProjectId as the X-Goog-User-Project creating an impossible to resolve situation without manually enabling the serviceusage API.
It's not impossible to resolve- this can be resolved by using a billing project or by using an aliased provider without UPO enabled.
I'll also note that the impact here is likely fairly small. It's relatively uncommon that a configuration both needs UPO set and is creating a project:
Note: We discussed this. We're somewhat undecided- this would help new users and users with complex ticket-based provisioning systems, but tainting the project in the case of a failure is a pretty rough outcome.
I'm not sure if this issue should be forwarded to the service team in its current state, so exempting it for now.
Same problem i didn't get what is the workaround sorry ?
today we enable the API by hand everytime we need a new project but it's not something perfect ...
Same here. Does anyone have the workaround for this issue? I believe it's almost synonymous with not being able to create and manage projects from Terraform if we can't solve this issue...
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.Description
After creating a project no APIs will be enabled. If the user_project_override config is true and no billing_project is given, subsequent requests to list APIs via the serviceusage API will fail. This is caused by the list services request using the newly created project.ProjectId as the X-Goog-User-Project creating an impossible to resolve situation without manually enabling the serviceusage API.
By default the Google Cloud console enables a set of service that is too broad to enable all by default: https://cloud.google.com/service-usage/docs/enabled-service#default
For this use case it makes sense to always enable the Service Usage API as it is required to list and enable any other services after creating a project.
Terraform Version
v1.3.6
Affected Resource(s)
Terraform Configuration Files
This is modified from my configuration...
Debug Output
Expected Behavior
Project is created and serviceusage.googleapis.com is enabled.
Actual Behavior
I get an error scenario where the service usage api can list itself on the project so it is unable to turn it on.
Steps to Reproduce
terraform apply
Important Factoids
billing_project
is specified, ideally to use the target resources project