We had Apigee subscription on 2 projects, on the first project; i was able to create an instance without any error, while on the other project i received the following error from terraform and also from GCP console
Terraform error
"terraform apply": [31mโ[0m [0m[1m[31mError: [0m[0m[1mError waiting to create Instance: Error waiting for Creating Instance: Error code 13, message: Internal error during operation. Please retry the operation. If the error persists, please contact Apigee support
first time on the console:
Creation of instance us-west1 failed: couldn't find a free IP space of /28 to launch an instance. Verify the peering ranges are available as per https://cloud.google.com/apigee/docs/api-platform/get-started/install-cli#service-networking and try again, FLOW_SN_SF_NO_FREE_BLOCKS_IN_ALLOCATED_RANGES (failed precondition)
second time - manually inputting the IP
Creation of instance us-central1 failed: Internal error during operation. Please retry the operation. If the error persists, please contact Apigee support
Has anyone experienced such error before? and how was it fixed?
Hello @ibrahim-jimoh .
I have experienced the same issue. Unfortunately, i haven't found a way to fix it yet.
My config:
tf version: 1.3.0
tf providers versions:
google = {
source = "hashicorp/google"
version = ">= 4.53.1"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.53.1"
}
tf module: cloud-foundation-fabric
tf module definition:
module "apigee" {
source = "git::https://gitlab.my-private-domain.dev/infra/modules.git//cloud-foundation-fabric/modules/apigee?ref=master"
project_id = module.service-project.project_id
organization = {
display_name = "Shop"
description = "Shop"
authorized_network = local.network_id
runtime_type = "CLOUD"
billing_type = "PAYG"
analytics_region = "europe-west1"
}
envgroups = {
shop-test = ["shop-apigee-test.local."]
}
environments = {
shop-apis-test = {
display_name = "Shop APIs Test"
description = "Shop APIs Test"
envgroups = ["shop-test"]
}
}
instances = {
shop-apigee-instance-test = {
region = "europe-west3"
environments = ["shop-apis-test"]
runtime_ip_cidr_range = "${local.runtime_apigee_address_test}/22"
troubleshooting_ip_cidr_range = "${local.troubleshooting_apigee_address_test}/28"
}
}
}
Same as you - this config works in one project and doesn't work in another.
@artem-chel
I think i know the fix to your tf module.
use this source to your module:
source = "github.com/terraform-google-modules/cloud-foundation-fabric//modules/apigee?ref=v28.0.0"
Module fix:
# Apigee Instance
instances = {
europe-west3 = {
runtime_ip_cidr_range = "${local.runtime_apigee_address_test}/22"
troubleshooting_ip_cidr_range = "${local.troubleshooting_apigee_address_test}/28"
environments = ["shop-apis-test"]
}
}
@ibrahim-jimoh , thank you for your suggestion, but I am using a module that was uploaded to my private Git repository a year ago. I acknowledge that the module's sources are quite old, but I recently tested (a couple of days ago) it in another GCP project, and it worked correctly.
Therefore, I assume the problem does not lie in the module definition or module sources.
Hi @ibrahim-jimoh, we finally managed to solve the issue.
I'll shed a little light on the details of the problem in our case.
The reason is in the network configuration of the project where we tried to create apigee instance (we are using sahred-vpc scheme).
It turns out that if you have high values (~> 800 in our case) configured for these two quotas:
This may cause a conflict with the quota values that are set in the service project in which apigee is created on the google side.
In our case we increased quotas in the service project on the google side with the help of google support and it solved the problem.