limited-lighter-76074
02/10/2024, 6:59 PMnetwork = gcp.compute.Network(
"network", project=project_id, auto_create_subnetworks=False
)
# Create a subnet within the VPC in europe-west1 region
subnet = gcp.compute.Subnetwork(
"vpc-private-subnet",
project=project_id,
region=main_settings.GCP_DEFAULT_REGION,
network=network.self_link,
private_ip_google_access=True,
stack_type="IPV4_ONLY",
ip_cidr_range="10.0.0.0/24",
)
vpc_subnet_connector = gcp.vpcaccess.Connector(
"vpc-conn",
# subnet=gcp.vpcaccess.ConnectorSubnetArgs(
# name=subnet.name
# ),
network=network.id,
ip_cidr_range="10.0.0.0/28",
machine_type="e2-micro",
min_instances=2,
max_instances=3,
region=subnet.region
)
This complains that it can't create the connector because:
Invalid IP CIDR range was provided. It conflicts with an existing subnetwork. Please delete the connector manually.
I don't understand, is creating a connector trying to create a new subnetwork?
I am trying to create a subnetwork with private_google_access so my cloudrun services can communicate with one another through internal traffic in the VPC.
I know that an ALB is probably a better option in terms of discovery, but I don't want any load balancing here.
What am I missing?