• Task
  • Version · 6.0
  • Create

Connect to Cloud SQL for PostgreSQL using GCP IAM authentication

Last updated: September 29, 2026

Before you begin

Procedure

1

Choose the identity Liquibase will authenticate as

gcloud config get-value project

gcloud projects list
loading
gcloud iam service-accounts list --format="value(email)"
2

Grant the Cloud SQL IAM roles

loading
3

Create the IAM database user

loading
4

Grant database privileges

loading
5

Provide Google Cloud credentials

gcloud auth application-default login
loading
6

Configure the connection

7

(Optional) Impersonate a service account

loading
liquibase.cloudsql.targetServiceAccount: your_target_service_account
8

(Optional) Chain impersonation through delegates

liquibase.cloudsql.delegates: your_delegate_service_account
liquibase.cloudsql.targetServiceAccount: your_target_service_account
9

Create a changelog file

loading

loading

loading

loading
10

Test your connection

liquibase --changelog-file=changelog.xml status
liquibase --changelog-file=changelog.xml update
loading