-
Notifications
You must be signed in to change notification settings - Fork 58
Open
Description
Summary
Google AppScript projects are hosted in GCP projects. These GCP projects are created in the GCP organization. While these can be deleted, and AppScript projects can be redirected to standard GCP projects, it is easier to leave the default configuration.
Depending on how the AppScript is written, a new project can be created every time, leading to many GCP projects being created in the organization. These projects are all created in the system-gsuite/apps-script folder. In all GCP organization, the folder ID for this folder is
Resources
Resolution
Update the script to remove the apps-script folder from the project count. Example:
ORG_ID="$(gcloud organizations list --format=json | jq -r '.[].name' | cut -f2 -d/)"
FOLDERS="$(gcloud resource-manager folders list --organization="${ORG_ID}" --format=json)"
GSUITE_FOLDER_NAME="$(jq -r '.[] | select(.displayName=="system-gsuite") | .name' <<< $FOLDERS)"
GSUITE_FOLDER_ID="$(cut -f2 -d/ <<< $GSUITE_FOLDER_NAME)"Now query the projects in the GCP organization and filter out the gsuite projects
gcloud projects list --filter="parent.id!=${GSUITE_FOLDER_ID)" --format=jsonMetadata
Metadata
Assignees
Labels
No labels