We've been using Cloud SQL for months without problems. Today we started to get a lot of HTTP 500 errors on our application logs. Upon debugging, we found out that the cause was that the private IP of our Cloud SQL PostgreSQL instance changed from 10.96.96.2 to 10.96.96.3, hence the app was unable to connect to the backend DB.
According to this doc: https://cloud.google.com/sql/docs/postgres/private-ip
The private IP address of the Cloud SQL instance is static; it does not change.
Did any of you experience something like this before? Is there any way to specify some kind of "internal hostname" instead of using the IP address directly?
Official answer from Google after reporting this issue:
After reviewing your issue I found that the change on the private ip of your PostgreSQL instance was produced after a scheduled maintenance rollout.
Please point your connections to the new private ip
Regarding to your question, as you correctly mentioned previously this isn’t an common behaviour of the statics ip's on Cloud SQL so you don’t need to take further actions in order to avoid this happening in the future.