I have following code:
resource "google_compute_global_address" "sql_block" {
name = "private-ip-block"
purpose = "VPC_PEERING"
address_type = "INTERNAL"
ip_version = "IPV4"
prefix_length = 24
address = "10.200.1.0"
network = "my network"
}
And then use this allocated block to create a link as follows:
resource "google_service_networking_connection" "cloud_sql_conn" {
network = "my network"
service = "servicenetworking.googleapis.com"
reserved_peering_ranges = [google_compute_global_address.sql_block.name]
}
Creating the connection fails with following message however:
Error waiting for Create Service Networking Connection: Error code 3, message: An IP range in the peer network (10.10.54.0/24) overlaps with an IP range in the local network (10.10.0.0/16)
Above message makes sense as two ranges overlap. What I dont understand is how the private allocated block became 10.10.54.0/24 instead of 10.200.1.0/24 as specified.