I'm using postGraphile as a GraphQL server - works great locally.
Trying to push it into an App Engine instance.
Cannot for the life of me figure out how to get the App Engine to connect to Cloud SQL. I can direct connect to Cloud SQL from my computer (I'm white-listed), and I even tried whilelisting the IP of the app engine instance to no effect
Here's my app.yaml settings:
# per google's instructions, I'vd added the instance here, and now added a tcp port
beta_settings:
cloud_sql_instances: webstr-dev-237715:us-central1:webstr-dev=tcp:5432
# [START runtime]
runtime: nodejs
env: flex
threadsafe: yes
service: wgraphile
In my package.json, I run postgragphile with a connection parameter. If I run this connection string:
postgraphile -o -c postgres://webstr:[SECRET]@localhost:5432/str_dev
I get a connection refused error:
A serious error occurred when building the initial schema. Exiting because `retryOnInitFail` is not set. Error details:
Error: connect ECONNREFUSED 127.0.0.1:5432
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1106:14)
If I run it with this connection string:
postgraphile -o -c postgres://webstr:[SECRET]@172.17.0.1:5432/str_dev
I get this connection reset error:
Postgres connection: postgres://webstr:[SECRET]@172.17.0.1/str_dev
‣ Postgres schema(s): public
A serious error occurred when building the initial schema. Exiting because `retryOnInitFail` is not set. Error details:
Error: read ECONNRESET
at TCP.onStreamRead (internal/stream_base_commons.js:111:27)
I have also tried using a unix socket connection string with the direct IP like:
postgres://webstr:[SECRET]@35.202.32.69:5432/str_dev?unix_sock=/cloudsql/<cloud_sql_instance_name>/.s.PGSQL.5432
Help?