The service account used by my App engine has the following permission:
App Engine deployment config file (app.yaml)
service: demo-app
runtime: custom
env: flex
manual_scaling:
instances: 1
resources:
cpu: 1
memory_gb: 0.5
disk_size_gb: 10
vpc_access_connector:
name: projects/<PROJECT_ID>/locations/<REGION>/connectors/sample-connector
service_account: app-engine@<PROJECT_ID>.iam.gserviceaccount.com
Because you use App Engine Flex, you have to specify the network in your configuration. The VPC access connector has no effect here.
If you set correctly the network, the same as your Cloud SQL instance is connected, simply use the Cloud SQL private IP and directly access to your database.