An open API service indexing awesome lists of open source software.

https://github.com/musictechlab/mtl-gcloud-utils

Shell utilities for bulk-deleting Google Cloud projects with retries and logging.
https://github.com/musictechlab/mtl-gcloud-utils

devops gcloud google-cloud shell

Last synced: about 13 hours ago
JSON representation

Shell utilities for bulk-deleting Google Cloud projects with retries and logging.

Awesome Lists containing this project

README

          

# cleanup.sh — Delete multiple GCP projects (and keep going)

[![Built by MusicTech Lab](https://musictechlab.io/oss/build-by-musictechlab.io.svg)](https://musictechlab.io)

This script deletes a list of Google Cloud projects and **continues on errors**.
It retries transient failures with exponential backoff and logs results to files.

## What it does

- Iterates over a hardcoded `projects=(...)` list
- Runs `gcloud projects delete --quiet`
- Retries up to `$RETRIES` times with backoff `$BACKOFF_BASE`
- Skips non-retriable errors (e.g., **PERMISSION_DENIED**, **NOT_FOUND**)
- Writes:
- `deleted_projects.txt` — successfully deleted project IDs
- `failed_projects.txt` — failed/skipped IDs with error messages

## Prerequisites

- Google Cloud SDK (`gcloud`) installed and authenticated:
```bash
gcloud auth login
gcloud auth list
```

## License

MIT License — see [LICENSE](LICENSE) for details.

---


MusicTech Lab - Rockstars Developers dedicated to the Music Industry

Website
|
LinkedIn
|
Let's talk

Crafted by musictechlab.io