Authentication
gcpdiag supports authentication using multiple mechanisms:
-
Application default credentials
gcpdiag can use Cloud SDK’s Application Default Credentials. This might require that you first run
gcloud auth login --update-adcto update the cached credentials. This is the default in Cloud Shell because in that environment, ADC credentials are automatically provisioned. -
Service account key
You can also use the
--auth-keyparameter to specify the private key of a service account.
The credentials that you use with gcpdiag needs to have at minimum the following roles granted (both of them):
Vieweron the inspected projectService Usage Consumeron the project used for billing/quota enforcement, which is per default the project being inspected, but can be explicitly set using the--billing-projectoption
The Editor and Owner roles include all the required permissions, but we
recommend that if you use service account authentication (--auth-key), you
only grant the Viewer+Service Usage Consumer on that service account.