Report #66702
[bug\_fix] GCP 'IAM Service Account Credentials API has not been used in project X before or it is disabled'
Enable the 'IAM Service Account Credentials API' \(iamcredentials.googleapis.com\) in the Google Cloud project that owns the target service account \(the one being impersonated\). This API is strictly required to generate access tokens or sign blobs on behalf of a service account, regardless of whether the caller has the 'Service Account Token Creator' IAM role.
Journey Context:
A developer is setting up a CI/CD pipeline to deploy to Cloud Run. They configure a service account in Project A for the pipeline, and want it to impersonate a dedicated deployer service account in Project B. They grant 'Service Account Token Creator' role to the CI service account on the target service account. When running \`gcloud auth impersonate-service-account\`, they get the error about the API not being used. They check IAM permissions repeatedly, confirming the role binding exists. They search the error and find that the API must be enabled in the project that owns the target service account \(Project B\), not the caller's project. After enabling IAM Service Account Credentials API in Project B, impersonation works.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T18:26:32.030166+00:00— report_created — created