Skip to content

Instantly share code, notes, and snippets.

@apolloclark
Created January 26, 2021 20:03
Show Gist options
  • Save apolloclark/f29694084084588ad237069a3f36f864 to your computer and use it in GitHub Desktop.
Save apolloclark/f29694084084588ad237069a3f36f864 to your computer and use it in GitHub Desktop.
Google Cloud cheatsheet
# list current config details
gcloud info

# list accounts
gcloud auth list

# list availalbe configs
gcloud config configurations list



# get currently active account
export GCP_ACCOUNT=$(gcloud auth list --format=json | jq '.[].account' -r);

# list billing accounts
gcloud alpha billing accounts list 

# list orgs
gcloud organizations list

# list projects
gcloud projects list

# list project service accounts
gcloud projects get-iam-policy <project_name>

# list service accounts
gcloud iam service-accounts list

# list account permissions
gcloud iam service-accounts

# list service account keys
gcloud iam service-accounts keys list --iam-account=${GCP_ACCOUNT}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment