gc
Dry-run discovery and interactive deletion of orphaned AWS resources left behind by failed deployments, deleted PR previews, or manual console changes — protecting your AWS bill without leaving the terminal.
What it does
Section titled “What it does”- Scans ECR repositories matching
<project-name>-*for untagged images and batch-deletes them. - Scans CloudWatch log groups under
/ecs/<project-name>-*(preview leftovers; the live/ecs/<project-name>group is never matched) and deletes them. On--target lambdaprojects it scans/aws/lambda/<project-name>-*instead, always excluding the live/aws/lambda/<project-name>-fngroup. - Scans Elastic IPs and releases any without an association (stops the hourly unused-EIP charge).
- Paginates all discovery APIs, so large accounts are fully scanned.
- Prints a categorized dry-run summary with per-target counts before asking anything.
npx grada-run gcnpx grada-run gc --region eu-west-1| Flag | Description |
|---|---|
--region <region> |
Explicit AWS region override. |
--project-name <name> |
Explicit project name override (defaults to app_name in terraform/main.tf, then the current directory name). |
Safety
Section titled “Safety”Deletion requires explicit interactive confirmation (Are you sure you want to permanently delete these orphaned resources? (y/N), defaulting to no). There is intentionally no --yes flag, so the command can never wipe resources from a CI pipeline by accident. Declining or cancelling deletes nothing; finding nothing skips the prompt entirely.