Reputation: 673
I have a GCP project running Cloud SQL and a Django App inside a Google App Engine Flexible Environment and it works fine. However, when I try to connect to the same Cloud SQL instance from another project it doesn't work since the socket is not being created as specified by the cloud_sql_instances in app.yaml:
runtime: custom
env: flex
automatic_scaling:
min_num_instances: 1
beta_settings:
cloud_sql_instances: myproject:myzone:mydbinstance
env_variables:
SQLALCHEMY_DATABASE_URI: >-
postgresql+psycopg2://myuser:mypass@/mydb?host=/cloudsql/myproject:myzone:mydbinstance
Steps to reproduce:
$ ls /cloudsql/
-> should show the socket file$ ls /cloudsql/
-> the directory is empty, the socket is not there.How can I get project B to show the socket?
Upvotes: 1
Views: 2699
Reputation: 673
I solved it by enabling the Cloud SQL Administration API for project B. Before, I only had it enabled for project A.
Upvotes: 2