Last active
October 18, 2024 06:52
-
-
Save jsmcnair/d0cada209350bc528606ac32d64587cd to your computer and use it in GitHub Desktop.
Useful gcloud commands
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
PROJECT="<project_name>" | |
REGION="<region_name>" | |
# Delete all filestore backups in $PROJECT $REGION using gcloud CLI | |
gcloud filestore backups list --project $PROJECT --region $REGION --format "value(name)" | | |
xargs -d "\n" -I '{}' gcloud filestore backups delete '{}' --region $REGION --quiet --async --project $PROJECT | |
# Delete all disk snapshots in $PROJECT | |
gcloud compute snapshots list --project $PROJECT --format "value(name)" | | |
xargs gcloud compute snapshots delete --project $PROJECT | |
# Delete all secrets in $PROJECT | |
gcloud secrets list --project $PROJECT --format "value(name)" | | |
xargs -d '\n' -I '{}' gcloud secrets delete '{}' --quiet --project $PROJECT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment