I’m trying to setup apigee-x in a existing gcp project but somehow, an error is showing up concerning to a contraint related to resource location which in the particular case is europe-west1
module.apigee.google_apigee_organization.organization[0]: Creating...
╷
│ Error: Error creating Organization: googleapi: Error 400: Precondition check failed.
│ Details:
│ [
│ {
│ "@type": "type.googleapis.com/google.rpc.PreconditionFailure",
│ "violations": [
│ {
│ "description": "'global' violates constraint `constraints/gcp.resourceLocations` on the resource 'projects/*****, field name: Control Plane Region'",
│ "subject": "orgpolicy:projects/*****?zone=global",
│ "type": "constraints/gcp.resourceLocations"
│ }
│ ]
│ }
│ ]
│
│ with module.apigee.google_apigee_organization.organization[0],
│ on .terraform/modules/apigee/modules/apigee/main.tf line 22, in resource "google_apigee_organization" "organization":
│ 22: resource "google_apigee_organization" "organization" {
After some reading, found this statement..“Google manages these resources so that they are available redundantly inall zones within that region”. So, i’m trying to instantiate it, in a single zone cluster which is against by what seems to be the default multi-zone setup for apigee.. Looking into terraform docs, can’t see a way to specify a specific zone..
Humm.. Am i missing something? Also, the error, seems to be related…
"violations": [
│ {
│ "description": "'global' violates constraint `constraints/gcp.resourceLocations` on the resource 'projects/*****, field name: Control Plane Region'",
│ "subject": "orgpolicy:projects/*****?zone=global",
│ "type": "constraints/gcp.resourceLocations"
│ }
@davidanrod I’m not sure but that error kinda looks like a GCP Org level constraint that’s not letting you provision resources in specific regions/zones.
it’s definitely a constraint regarding region/zone.. but as i said earlier, at this point don’t know if apigee can run in a single zone within a specific region which is what i’m trying.. europe-west1 has 3 available zones, but my cluster is set only to single region/zone.
Based on that, how should i interpert the statement “Apigee organization resources can be created in many locations. These locations represent the geographical regions where Apigee resources, such as the Apigee runtime infrastructure and Apigee API Analytics data, are stored and accessed. Google manages these resources so that they are available redundantly in all zones within that region.” ?
Thank you for engaging in the Apigee community! Especially thanks to @davidanrod for sharing the solution. We look forward to seeing you both share more insights in the future.
The fix to add api_consumer_data_location field is partial fix. I still got the same error after adding that, To fully resolve the issue, you will need to add this line at the top of the terraform
Example for eu: provider “google-beta” { apigee_custom_endpoint = “https://eu-apigee.googleapis.com/v1/” }
Hello, I believe the issue is that the apigee_custom_endpoint key/value pair is only supported in the google_beta module version (not google). Could you try something as follows and let us know the results: provider “google-beta” { apigee_custom_endpoint = “https://eu-apigee.googleapis.com/v1/” }