Multi-service AWS resource cleanup automation with dry-run safety
Project description
AWS Automations - Multi-Service Cleanup
Portfolio-ready AWS cleanup tool with safe defaults, dry-run first, and a live CLI view.
Highlights
- Multi-service cleanup for S3, EC2, Lambda, EBS, CloudWatch, and IAM
- Dry-run by default;
--applyrequired for deletions - Filters: prefixes, target/ignore lists, optional tag requirement
- Age gates for buckets/objects; supports versioned buckets
- Live Rich table (opt-out with
--no-live) plus JSON output when needed - Safety switches to guard zero retention and delete-all modes
- Interactive per-bucket approval and batched deletes
Setup
python3 -m venv .venv
source .venv/bin/activate
pip install -U pip
pip install -e ".[dev]"
Runtime-only (no dev tools):
pip install -e .
Configure
Copy config.example.yaml to config.yaml and adjust:
bucket_prefixes,target_buckets,ignore_bucketsbucket_retention_days,object_retention_days,delete_all_objectsinclude_versioned_objects,delete_empty_buckets- Optional
require_tag: { key, value }
Run (S3 direct)
Dry-run (default):
python -m aws_automations.s3_cleanup --config config.yaml
Plan view (no apply) with live table on TTY:
python -m aws_automations.s3_cleanup --config config.yaml --plan --live
Apply deletions for specific buckets:
python -m aws_automations.s3_cleanup --config config.yaml --apply \
--bucket sandbox-a --bucket sandbox-b
Interactive approval per bucket:
python -m aws_automations.s3_cleanup --config config.yaml --apply --interactive
JSON summary (suppresses live UI):
python -m aws_automations.s3_cleanup --config config.yaml --plan --json
One-off include/exclude without editing config:
python -m aws_automations.s3_cleanup --config config.yaml --include temp-bucket --exclude ignore-me
Toggle live rendering:
python -m aws_automations.s3_cleanup --config config.yaml --no-live
Run (Interactive Menu)
Start the interactive menu for guided cleanup:
aws-menu
Or run directly:
python -m aws_automations.start
Run (multi-service orchestrator)
Clean up one or all services with a live table (default on TTY):
aws-cleanup --config config.yaml --service all --live
Or run via module:
python -m aws_automations.main --config config.yaml --service all --live
Focus on a single service (e.g., EC2) in dry-run:
python -m aws_automations.main --config config.yaml --service ec2
Emit JSON summary (suppresses live UI):
python -m aws_automations.main --config config.yaml --service lambda --json
Safety switches:
--force-zero-retentionrequired with--applywhenobject_retention_days <= 0--force-delete-allrequired with--applywhendelete_all_objects: true
Add --verbose for debug logs.
Tests
python -m pytest
Smoke Test
Quick verification that install and CLI wiring are healthy:
python3 -m pip install --upgrade aws-automations
aws-cleanup --help
aws-menu --help
python3 -c "from importlib.metadata import version; print(version('aws-automations'))"
Security Checks
- CI runs Bandit static security analysis on
aws_automations(Python 3.11 job). - Failing threshold is set to medium-or-higher severity/confidence.
bandit -r aws_automations --severity-level medium --confidence-level medium
Changelog
See CHANGELOG.md for versioned release notes.
Notes
- Uses paginated, batched deletes (S3 limits batches to 1,000 objects).
- Live UI is disabled automatically for JSON output or when stdout is not a TTY.
- Keep AWS credentials scoped to the buckets you intend to manage.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aws_automations-0.1.2.tar.gz.
File metadata
- Download URL: aws_automations-0.1.2.tar.gz
- Upload date:
- Size: 22.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b4f9faff87640c0179e20e660eda33a3f99db7ff598fabdba2bc48f818e6a29
|
|
| MD5 |
9d1a4224a7b81a9b805e2a4221ca1353
|
|
| BLAKE2b-256 |
b1adf6fe96207aa3c2c9086a2bb2e2fca174e6ab5f0181a6e429443599ee0f85
|
File details
Details for the file aws_automations-0.1.2-py3-none-any.whl.
File metadata
- Download URL: aws_automations-0.1.2-py3-none-any.whl
- Upload date:
- Size: 26.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a5723dc0ffe2bea00764e18bb930f42b7b8f3caf4c9dc0af78c505d35f615e71
|
|
| MD5 |
f755f8df6951f41c9f865b8fbfbc5030
|
|
| BLAKE2b-256 |
ae32773e7c16f13428ba549b65ef377e4c43fa61f6e33935a218a30bc5147e7b
|