I've being trying to create a new CloudSQL instance with a private IP attached from the get go. The only thing documentation hints me is to add a VPC network. I'm trying to add the default one.
First I'm enabling the correct APIs / services to my project:
gcloud services enable servicenetworking.googleapis.com servicemanagement.googleapis.com --project=my-project
Then I'm trying to create the CloudSQL instance:
gcloud beta sql instances create cloudsql-instance-name --region=europe-west1 --project=my-project --network=projects/my-project/global/networks/default
However this gives me this non descriptive error:
ERROR: (gcloud.beta.sql.instances.create) [INTERNAL_ERROR] Failed to create subnetwork. Please create Service Networking connection with service 'servicenetworking.googleapis.com' from consumer project '1234567890' network 'default' again.
Two questions:
- Is this the correct way to add a private IP to an instance upon creation? Or are there other ways?
- Why is it giving me this error and how can I resolve?
Thanks!