Installing an CloudSQL Database
How to install an CloudSQL database to P0
Before you begin
Existing Google Cloud (GCP) integration
Permissions to create roles and add IAM bindings:
iam.roleAdminiam.securityAdmin
Permissions to connect to the Cloud SQL instance, as an authorized user:
Grant access (
GRANT) to other usersCreate functions (
CREATE FUNCTION) within the database
Access to Google Cloud Shell and/or gcloud CLI installed and configured
Set up PostgreSQL Integration
To set up the PostgreSQL integration:
Go to P0.app in your browser. Select Integrations, then under the Resources section, click PostgreSQL.

From the list of Available components, click Access management.

Click + Add database.
Enter the Database identifier. This is a unique label to identify the database (e.g.
p0-production-db).
The Database identifier cannot be changed after installation. To change the database identifier the database must be uninstalled from P0 and reinstalled with a new identifier.
Click on Google CloudSQL and populate the details of your Google CloudSQL instance and click Next.
GCP project ID: Google Cloud project ID (e.g.
p0-demo).GCP region: Region where the CloudSQL instance is located (e.g.
us-central1)CloudSQL instance ID: ID of the CloudSQL instance which must have public IP access enabled (e.g.
my-cloudsql-instance-001)Database name: Name of the database to manage (e.g.
app_main_db)

Ensure P0 can manage user access to PostgreSQL roles. On the resulting Access management screen, Step 1 applies to Google Cloud and Steps 2 and 3 apply to Postgres.
Start by configuring Google Cloud, and copy the commands from Step 1.

Open the Google Cloud Shell in a new browser tab, and paste and run the copied commands.

From Google Cloud Shell, connect to your Cloud SQL PostgreSQL instance using the psql command. Replace
REGIONwith your actual region (for example,us-central1,us-east1, etc.).
Switch back to the Access management browser tab and copy the commands from Step 2 and Step 3.

Return to Google Cloud Shell and run the copied SQL commands.

After running the commands, switch back to the Access management browser tab and click Next.

Click Finish to finalize your configuration.


Congratulations! You've now set up PostgreSQL for P0.
Last updated