Last active
June 25, 2022 01:23
-
-
Save siberex/d8dd3b480aba148562fc4254b6489873 to your computer and use it in GitHub Desktop.
Google App Engine: List all projects along with their regions and mapped domains
This file contains 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
# App Engine: List all project regions and mapped domains | |
# Effectively: | |
# gcloud projects list --format 'get(PROJECT_ID)' | |
# gcloud app describe --project "$projectId" --format 'get(locationId)' | |
# gcloud app domain-mappings list --project "$projectId" --format 'get(ID)' | xargs | sed 's/ /, /g' | |
printf "%s\t%s\t%s\n" "ProjectId" "Region" "Domains" | |
gcloud projects list --format 'get(PROJECT_ID)' | while read -r projectId; do | |
region=$(gcloud app describe --project "$projectId" --format 'get(locationId)' 2>/dev/null || echo 'N/A') | |
domains=$((gcloud app domain-mappings list --project "$projectId" --format 'get(ID)' 2>/dev/null || echo 'N/A') | xargs | sed 's/ /, /g') | |
printf "%s\t%s\t%s\n" "$projectId" "$region" "$domains" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment