I'm using Pulumi to manage GCP infrastructure. I want to create a Cloud SQL instance with a private IP but it keeps failing stating :
error: 1 error occurred:Error waiting for Create Service Networking Connection: Error code 9, message: Allocated IP range 'dbprivip' not found in network.
I'm creating an Global address and trying to attach it to the Private Connection. The ip exists
NAME ADDRESS/RANGE TYPE PURPOSE NETWORK REGION
SUBNET STATUS dbprivip 10.0.10.5 INTERNAL PRIVATE_SERVICE_CONNECT bastionvpc RESERVED
jumpserverpubip 34.155.83.36 EXTERNAL europe-west9 IN_USE
Here's the code I have written:
db_ip_reserved_range = gcp.compute.GlobalAddress(
"DbIpRange",
name = "dbprivip",
purpose = "PRIVATE_SERVICE_CONNECT",
address_type = "INTERNAL",
network = vpc_network.id,
address = DB_PRIV_IP
)
private_network_con = gcp.servicenetworking.Connection(
"DbPrivateConnection",
opts = pulumi.ResourceOptions(
depends_on = [
db_ip_reserved_range
]),
network = vpc_network.id,
reserved_peering_ranges = [
db_ip_reserved_range.name
],
service = "servicenetworking.googleapis.com"
)
I begin to wonder if that's not a bug in the pulumi_gcp provider. I have tried with Terraform following the examples in the documentation and I have the same result.