To resolve this issue, you can try the following solutions:
Allocate a new IP range: Go to the “VPC Networking” section in your Google Cloud Platform (GCP) console. Click on the “default” network, then navigate to the “Private service connection” tab. Click on the “Allocate IP Range” button and assign a new IP range, such as a /24 range. After creating the new range, go to the “Private connections to services” submenu and click on the connection name (e.g., cloudsql-postgres-googleapis-com).
Verify private service access configuration: Make sure that private service access has been properly configured. Refer to the Google Cloud documentation for guidance on configuring private service access
Allocate an IP CIDR range and update the private connection: In the VPC networks section, allocate an IP CIDR range specifically for your SQL instance. Use the “Allocated IP ranges for service” option to allocate the range. Then, add this CIDR range to the “Private Connection to Service”. If there is an existing connection, you can use the following command to force the addition of the CIDR range to the private connection:
The command gcloud beta services vpc-peerings update with the --force option is used to update the VPC peering configuration for a specific network and allocated CIDR range. It does not directly affect the IP addresses of existing databases.
However, if the CIDR range being updated overlaps with the existing CIDR range used by the database instances, it can potentially impact the IP addresses of the instances. In such cases, the instances may need to be reconfigured to use IP addresses from the new CIDR range.
Before running the command with the --force option, it’s important to review the impact and potential risks. Ensure that you understand the implications and have a backup plan in case any issues arise.
To minimize the impact on existing databases, it’s recommended to carefully choose a new CIDR range that does not overlap with the existing range, if possible. This way, you can allocate additional IP addresses without affecting the IP addresses of the first database created.