Created
February 2, 2021 23:13
-
-
Save davidalger/a8f25d6a888b3444cbc2e2f08f03fc91 to your computer and use it in GitHub Desktop.
GCP Asset Inventory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PS1='$ ' && clear | |
GCP_PROJECT=my-first-project \ | |
&& gcloud services enable cloudasset.googleapis.com --project "${GCP_PROJECT}" \ | |
&& echo Waiting for API enablement to propagate \ | |
&& utimer -c 2m \ | |
&& gcloud asset search-all-resources --scope "projects/${GCP_PROJECT}" --sort-by 'assetType' \ | |
--format='table(assetType.basename(), name.basename(), name.scope(projects).segment(0):label=PROJECT_ID, labels)' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment