Error: Error creating Organization: googleapi: Error 400: Invalid resource field value in the request.
Details:
“@type”: “type.googleapis.com/google.rpc.ErrorInfo”,
“domain”: “googleapis.com”,
“metadata”: {
“method”: “google.cloud.apigee.v1.OrganizationService.CreateOrganization”,
“service”: “apigee.googleapis.com”
│ “reason”: “RESOURCE_PROJECT_INVALID”
with google_apigee_organization.apigee_org,
│ on main.tf line 36, in resource “google_apigee_organization” “apigee_org”:
│ 36: resource “google_apigee_organization” “apigee_org” {
How to decide on usage of terraform version number and hashicorp version number in version.tf
Line 36 of main.tf refers to resource “google_apigee_organization” “apigee_org”
On your 2) the version number for the google provider is ensure the features you rely on are present (or set a min version) like we do in cloud foundation fabric
Thanks for details I am running them locally into the cloud using oogle terminal with gcloud and ran the terraform apply after gcloud auth login & got rid of 400 error
Listed error with 409 (below error message indicates it creating the organization, there will be instance, where the google organization would have been already created… and indicates that organization is associated with another project
google_apigee_organization.apigee_org: Creating…
╷
│ Error: Error creating Organization: googleapi: Error 409: org mytestorg already associated with another project
│ Details:
│ “@type”: “type.googleapis.com/google.rpc.RequestInfo”,
│ “requestId”: “15421041526339720505”
│ with google_apigee_organization.apigee_org,
│ on main.tf line 36, in resource “google_apigee_organization” “apigee_org”:
│ 36: resource “google_apigee_organization” “apigee_org” {
For instance, where we need to update existing apigee control plane, my use case mandates only thro terraform, hence will it thro error for existing setup ? or option to indicate that its a modification than creating everything…
This is the variables file that you use to configure the module. Module references don’t really make sense in this context. The sibling main.tf refers to downstream modules.
Can you confirm that mytestorg is the name of your GCP project? The Apigee Org’s name must match your GCP project Id.
The terraform resource should take care of the update. You declaratively set your desired state and it figures out which modifications are needed to get there.
“mytestorg” is the modified name didn’t want to post real name
If the whole set up already exists, for apigee control plane (and terraform apply has to run, for existing set it up) do we need to run terraform apply using any of update (additional) option in apply command or with any additional command or options ? Because the error indicated about creating of organization, with 409 (which already exists). ie Apigee control plane exists and org is associated with project , when we run apply command and getting above error as indicated above, hence wondering any additional command or options is required ?
Yes this can happen if your terraform state doesn’t match the effective state because some resources were created outside of terraform or because the local state got deleted. In this case a terraform import could bring them back in.