hashicorp / terraform-provider-google

Terraform Provider for Google Cloud Platform
https://registry.terraform.io/providers/hashicorp/google/latest/docs
Mozilla Public License 2.0
2.26k stars 1.71k forks source link

UREQ_SERVICE_REQUIRES_PROCUREMENT #10793

Closed tianmarin closed 9 months ago

tianmarin commented 2 years ago

Community Note

Terraform Version

Terraform v1.1.0

Affected Resource(s)

Terraform Configuration Files

services = [
    "compute.googleapis.com",
    "cloudresourcemanager.googleapis.com",
    "cloudbilling.googleapis.com",
    "iam.googleapis.com",
    "stackdriver.googleapis.com",
    "logging.googleapis.com",
    "storage-api.googleapis.com",
    "serviceusage.googleapis.com",
    "cloudkms.googleapis.com",
    "cloudvolumesgcp-api.netapp.com",
  ]
resource "google_project_service" "services" {
  for_each           = toset(var.services)
  service            = each.key
  project            = google_project.project.project_id
  disable_on_destroy = false
}

Panic Output

Error: Request `Enable Project Service "cloudvolumesgcp-api.netapp.com" for project "xxx-xxx-xxx"` returned error: failed to send enable services request: googleapi: Error 400: The service 'cloudvolumesgcp-api.netapp.com' in project '123456789012' can only be enabled after first procuring in the Marketplace. Please visit: http://console.cloud.google.com/apis/api/cloudvolumesgcp-api.netapp.com.
│ Help Token: Ae-hA1PrCKaXXXP3B9dfqZrDCWcdwO8usjE-mbcXezDHU_0V6Lk1nymaw2IRg9OxySBNYk_LWlCYZ1lr0bggOnHCS9eI9Y-lCOwRLuCZs_iox4ir
│ Details:
│ [
│   {
│     "@type": "type.googleapis.com/google.rpc.PreconditionFailure",
│     "violations": [
│       {
│         "subject": "?error_code=390000\u0026service_name=cloudvolumesgcp-api.netapp.com\u0026project=123456789012",
│         "type": "googleapis.com"
│       }
│     ]
│   },
│   {
│     "@type": "type.googleapis.com/google.rpc.ErrorInfo",
│     "domain": "serviceusage.googleapis.com",
│     "metadata": {
│       "project": "123456789012",
│       "service_name": "cloudvolumesgcp-api.netapp.com"
│     },
│     "reason": "UREQ_SERVICE_REQUIRES_PROCUREMENT"
│   }
│ ]
│ , failedPrecondition
│ 

Expected Behavior

Activate the service

Actual Behavior

Error when activating service

Important Factoids

My configuration files are too big and dependent of modules, so i've trimmed a lot for focusing on the issue. The message error: The service 'cloudvolumesgcp-api.netapp.com' in project '123456789012' can only be enabled after first procuring in the Marketplace.

However, how can this be achieved in an automated fashion? My main goal is to create projects and resources in a complete automated way.

The Netapp Cloud Volumes Service (cloudvolumesgcp-api.netapp.com) is available under gcloud services list --available

b/304725286

roaks3 commented 9 months ago

Per the internal team, this is working as expected. There are a small number of Marketplace services that must be procured through Marketplace before they can be enabled.

github-actions[bot] commented 8 months ago

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.