I'm really confused about how IAM login works with AlloyDB. I don't see anything in the docs about mapping postgres users to IAM service accounts.
With Cloud SQL Postgres I can do this: https://cloud.google.com/sql/docs/postgres/authentication
- I create a service account
- Create a cloud sql user of type
CLOUD_IAM_SERVICE_ACCOUNT
, (gcloud sql users create <GSA> --type=CLOUD_IAM_SERVICE_ACCOUNT
) - Log in to postgres and give that postgres user access to only its own database.
Applications auth to their own postgres DB through their IAM service account (via the proxy) and cannot access other DBs on the postgres server.
How do I do this with AlloyDB?
Looking at the docs I see some mention of CLOUD_IAM_USER
https://cloud.google.com/alloydb/docs/database-users/about#view-list
But I cannot see how to create AlloyDB users via the API:
Does the sql users
API also support AlloyDB? With Cloud SQL I can create IAM service account users via the Cloud SQL API.