This sample demonstrates how to use PostgreSql on Google App Engine standard Java 11
-
Download and initialize the Cloud SDK
gcloud init -
If this is your first time creating an App engine application:
gcloud app create
-
Setup Application Default Credentials
gcloud auth application-default login -
Note the Instance connection name under Overview > properties
Edit the app.yaml file and change the 4 env variables to match your environment:
env_variables:
DB_INSTANCE: PROJECT:us-central1:instance
DB_DATABASE: DBname
DB_USER: postgres
DB_PASSWORD: password
mvn clean package appengine:deploy -Dapp.deploy.projectId=<your-project-id>