GCP Service Account Access

I’m looking for a way to grant a GCP service account permission to access another service account specifically.

Say we have service account X and service account Y. My goal is to give X access to act as Y, but ONLY as Y. This means I don’t want to provide X with a project wide ServiceAccountUser permission. In the Google Console UI, you can navigate to service account Y and grant specific permission to service account X to accomplish this but I can’t seem to find any resource to replicate this in Terraform making it hard to create/import.

1 Like

I believe the google_service_account_iam_member may help

2 Likes

Thanks everyone, I overlooked the google_service_account_iam_member resource. The google_service_account_iam_binding seems like it should work as well.