sincecutoff.com
← all changes

gcloud beta alloydb connect uses AlloyDB Auth Proxy and psql

Introduced 2026-03-31 · score 0.97

HOW TO USE IT

When you need an interactive connection to an AlloyDB instance, run `gcloud beta alloydb connect` with its instance, cluster, and region; it starts the AlloyDB Auth Proxy and `psql` session.

gcloud beta alloydb connect <INSTANCE_ID> --cluster=<CLUSTER_ID> --region=<REGION_ID>
gcloud beta alloydb connect <INSTANCE_ID> --cluster=<CLUSTER_ID> --region=<REGION_ID> --public-ip
gcloud beta alloydb connect <INSTANCE_ID> --cluster=<CLUSTER_ID> --region=<REGION_ID> --auto-iam-authn

WHY THIS HELPS

Connect to an AlloyDB instance from a coding workflow using the CLI.

REQUIREMENTS AND LIMITATIONS

  • Availability: beta
  • INSTANCE_ID (required): AlloyDB instance ID.
  • --cluster=<CLUSTER_ID> (required): AlloyDB cluster ID.
  • --region=<REGION_ID> (required): Regional location of the cluster.
  • --database=<DATABASE> (-d): Database to connect to.
  • --port=<PORT>: Local listener port for the Auth Proxy; default is 9471.
  • --user=<USER> (-u): Built-in database user. Mutually exclusive with `--auto-iam-authn`.
  • --auto-iam-authn: Enables Auto IAM authentication. Mutually exclusive with `--user`.
  • --psc: Connect using Private Service Connect. Mutually exclusive with `--public-ip`.
  • --public-ip: Connect using the instance's public IP. Mutually exclusive with `--psc`.
  • Prerequisite: Install the gcloud CLI and the `psql` client tool.
  • Prerequisite: The IAM principal needs the `roles/alloydb.client` role.
  • Prerequisite: Have a network path to the instance; for example, run the command from a VPC that can reach it.

FIRST-PARTY EVIDENCE

Check the installed version and the source before using it. Entry JSON

Report a problem with this card