Drux
Drux

Reputation: 12650

List access scopes from inside GCE VM instance

How can I find out from the command line of a Google Cloud Engine (GCE) VM instance which access scopes the instance possesses?

Upvotes: 5

Views: 3714

Answers (1)

Dagang Wei
Dagang Wei

Reputation: 26458

You can retrieve it from the metadata server, run the command from within the VM instance:

curl "http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/?recursive=true" -H "Metadata-Flavor: Google"

Scopes are in the serviceAccounts property of instances.

Upvotes: 9

Related Questions