Description:
It is recommended to configure Second Generation Sql instance to use private IPs instead of public IPs.
Rationale:
To lower the organization's attack surface, Cloud SQL databases should not have public IPs. Private IPs provide improved network security and lower latency for your application.
Removing the public IP address on SQL instances may break some applications that relied on it for database connectivity.
From Google Cloud Console
From Google Cloud CLI
gcloud sql instances patch --network= --no-assign-ip
gcloud sql instances describe
Prevention:
To prevent new SQL instances from getting configured with public IP addresses, set up a 'Restrict Public IP access on Cloud SQL instances' Organization policy at: https://console.cloud.google.com/iam-admin/orgpolicies/sql-restrictPublicIp.