1

When I look at the Console IAM dashboard for my project I can see the line item for my Cloud Build Service Account:

https://console.cloud.google.com/iam-admin/iam

Member                                           Role
PROJECT_ID@cloudbuild.gserviceaccount.com        Cloud Build Service Account

But when I list service accounts with the gcloud command the service account doesn't show up:

$ gcloud iam service-accounts list --project=$PROJECT
Listed 0 items.

Why is the PROJECT_ID@cloudbuild.gserviceaccount.com service account showing up?

1

The command below only shows the User-managed service accounts. (There are three types of Service Account in GCP) And you can see that list by going to your cloud console > IAM & Admin > Service Accounts.

gcloud iam service-accounts list --project=$PROJECT

If you want to show all types of Service Accounts that you see under IAM & Admin > IAM you will need to use the command below:

gcloud projects get-iam-policy $PROJECT-ID

To know more about this topic, you can check the official GCP documentation about Service Accounts.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.