Activate IAM Service Account Credentials API for using https://cloud.google.com/sdk/gcloud/reference/#--impersonate-service-account
otherwise, the following error would occur:
{
“error”: {
“code”: 403,
“message”: “IAM Service Account Credentials API has not been used in project [PROJECT_NUMBER] before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/iamcredentials.googleapis.com/overview?project=[PROJECT_NUMBER] then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.”,
“status”: “PERMISSION_DENIED”,
“details”: [
{
“@type”: “type.googleapis.com/google.rpc.Help”,
“links”: [
{
“description”: “Google developers console API activation”,
“url”: “https://console.developers.google.com/apis/api/iamcredentials.googleapis.com/overview?project=[PROJECT_NUMBER]"
}
]
}
]
}
}