You must have a Service Account with the Cloud SQL Client role.
You must create a key for this service account in JSON form. See Google's account keys documentation for more information. The access key must use the GCP Console/gcloud format (i.e., the first example in the linked documentation).
You must have the CloudSQL Admin API enabled for your project.
This guide explains how to connect PostgreSQL via the Google Cloud Platform account. If you need to connect it using a different cloud provider, contact us at [email protected]. You can add the GCP account in the Organization Settings.
Click on the Dynamic Resources tab.
Select Google Cloud Platform.
Humanitec will ask you to provide an Account Name (a memorable name that will be displayed for this account) and a Service Account Access Key JSON (see prerequisites).
Once you have added your account you will see the available Dynamic Resource Definitions.
In Organization Settings, Dynamic Resource tab, click on your Google Cloud Platform Account that you want to use for adding your PostgreSQL.
Click on PostgreSQL resource definition.
Add a memorable ID for this Resource Definition and select a driver, here - cloudsql.
Based on your resource driver, a form will be shown with the required driver parameters which will be passed to the driver on every resource creation. Add the values and click create.
Once created, the Resource Definition will appear in the list.
Assign your Resource Definition to an Environment Type.
Based on this Resource Definition, during the deployment on any of the matching environments, an Active Resource will be provisioned if required.