AWS Cloud Utilities v2
A unified command-line toolkit for AWS operations with enhanced functionality. This package consolidates various AWS management scripts into a single, powerful CLI tool.
Prerequisites
- Python 3.x
- Boto3 library
- AWS credentials configured (e.g., via ~/.aws/credentials or environment variables)
Installation
- Clone this repo
- Install the required Python packages (Pipenv in repo)
pipenv sync
Features
- Unified CLI: Single command interface for all AWS operations
- Parallel Processing: Multi-threaded operations for improved performance
- Rich Output: Beautiful, formatted output with tables and colors
- HTML Report Generation: Create comprehensive, responsive HTML reports for analysis and auditing
- Flexible Configuration: Support for AWS profiles, regions, and custom settings
- Comprehensive Coverage: Tools for cost optimization, inventory, security, logs, and more
Installation
# Install from PyPI
pip install aws-cloud-utilities
# Install from source
git clone https://github.com/jon-the-dev/aws-cloud-tools.git
cd aws-cloud-tools/v2
pip install -e .
Quick Start
# Get account information
aws-cloud-utilities account info
# Inventory all resources in your account
aws-cloud-utilities inventory scan
# Provision a Cost and Usage Report data source end-to-end
aws-cloud-utilities billing cur-setup --bucket my-cur-bucket
# Find the cheapest spot instances
aws-cloud-utilities costops spot-analysis
# Troubleshoot MySQL RDS connection issues
aws-cloud-utilities rds troubleshoot-mysql my-mysql-db
# Aggregate CloudWatch logs
aws-cloud-utilities logs aggregate --log-group /aws/lambda/my-function
# Collect security metrics (WAF, GuardDuty, Security Hub)
aws-cloud-utilities security metrics
# Analyze S3 encryption (generates HTML report)
aws-cloud-utilities s3 analyze-encryption --workers 20
Command Structure
The CLI follows a hierarchical structure similar to the AWS CLI:
aws-cloud-utilities [GLOBAL-OPTIONS] <service> <operation> [OPTIONS]
Global Options
--profile: AWS profile to use--region: AWS region--output: Output format (json, yaml, table)--verbose: Enable verbose logging--debug: Enable debug mode
Command Index
Every command group and its operations. Invoke as
aws-cloud-utilities <group> <command> [OPTIONS].
| Group | Purpose |
|---|---|
account |
Account information and management |
awsconfig |
AWS Config compliance monitoring |
bedrock |
Amazon Bedrock model management |
billing |
Billing and Cost & Usage Report (CUR) management |
cloudformation |
CloudFormation management and backup |
cloudfront |
CloudFront distribution management |
costops |
Cost optimization and pricing analysis |
dynamodb |
DynamoDB cost and capacity analysis |
ecr |
Elastic Container Registry management |
iam |
IAM management and auditing |
inventory |
Resource discovery and inventory |
logs |
CloudWatch Logs management and processing |
networking |
Networking and IP-range utilities |
rds |
RDS management and troubleshooting |
s3 |
S3 bucket and object management |
security |
Security monitoring and certificates |
stepfunctions |
Step Functions management and monitoring |
trusted-advisor |
Trusted Advisor and AWS support tools |
waf |
WAF management and troubleshooting |
account
info— Get AWS account informationcontact-info— Get AWS account contact informationdetect-control-tower— Detect AWS Control Tower or Landing Zone deploymentsregions— List all available AWS regionsservice-regions— List available regions for a specific AWS servicelimits— Get AWS service limits and usagevalidate— Validate AWS credentials and permissions
awsconfig
download— Download and process AWS Config files from S3 into CSV or JSONshow-rules— Show AWS Config rules with compliance metricslist-rules— List AWS Config rules with basic informationcompliance-status— Compliance status summary across rules and resourcescompliance-checker— Comprehensive compliance checker for various resource types
bedrock
list-models— List Amazon Bedrock foundation models across regionsmodel-details— Get detailed information about a specific Bedrock modellist-custom-models— List custom Bedrock modelslist-model-jobs— List Bedrock model customization jobsregions— List regions where Amazon Bedrock is available
billing
cur-setup— Provision an end-to-end CUR data source: bucket, policy, and Parquet report (new)cur-list— List all existing Cost and Usage Reportscur-details— Show detailed configuration for a specific CUR reportcur-create— Create a new Cost and Usage Report (CUR 2.0)cur-delete— Delete a Cost and Usage Reportcur-validate-bucket— Validate S3 bucket permissions for CUR delivery
cloudformation
backup— Backup CloudFormation stacks and templates across regionslist-stacks— List CloudFormation stacks with detailsstack-details— Get detailed information about a specific stack
cloudfront
update-logging— Enable logging on distributions and optionally set up alarmslist-distributions— List CloudFront distributions with configuration detailsdistribution-details— Get detailed information about a specific distributioninvalidate— Invalidate distribution cache by domain name or distribution ID
costops
pricing— Get AWS pricing information for servicescost-analysis— Analyze AWS costs using Cost Explorerebs-optimization— Analyze EBS volumes for cost optimization opportunitiesusage-metrics— Get detailed usage metrics for a specific AWS servicespot-pricing— Collect and analyze EC2 spot pricing across regionsspot-analysis— Analyze collected spot pricing to find cheapest options
dynamodb
cost-analysis— Analyze DynamoDB tables for capacity usage and estimated monthly cost
ecr
copy-image— Copy a Docker image from any registry to AWS ECRlist-repositories— List ECR repositories with detailslist-images— List images in an ECR repositorycreate-repository— Create a new ECR repositorydelete-repository— Delete an ECR repositoryget-login— Get Docker login command for ECR or execute login directly
iam
audit— Audit IAM roles and policies, saving them locallylist-roles— List IAM roles with detailslist-policies— List IAM policiesrole-details— Get detailed information about a specific IAM rolepolicy-details— Get detailed information about a specific IAM policy
inventory
scan— Comprehensive AWS resource inventory scan across services and regionsworkspaces— Generate a WorkSpaces inventory report with optional metricsservices— List all supported services for inventory scanningdownload-all— Download comprehensive inventory of all AWS resources
logs
list-groups— List CloudWatch log groups with detailsdownload— Download logs for a specific log group or all groupsset-retention— Set retention policy for a log groupdelete-group— Delete a CloudWatch log groupcombine— Combine multiple log files into a single sorted fileaggregate— Aggregate log files into larger files for efficient processing
networking
ip-ranges— Download and analyze AWS IP rangesip-summary— Show summary statistics of AWS IP ranges
rds
troubleshoot-mysql— Troubleshoot MySQL RDS connection issueslist-instances— List RDS instances in the current region
s3
list-buckets— List S3 buckets with region and optional size informationcreate-bucket— Create a new S3 bucket with optional configurationdownload— Download objects from a bucket with parallel processingnuke-bucket— Completely delete a bucket and all its contents (including versions)bucket-details— Get comprehensive details about a bucketdelete-versions— Delete object versions from a bucketrestore-objects— Restore objects from Glacier or other archive classesanalyze-encryption— Analyze bucket encryption configurations (parallel)
security
metrics— Collect security metrics from WAF, GuardDuty, and Security Hubcreate-certificate— Create an ACM certificate with Route53 DNS validationlist-certificates— List ACM certificates with details
stepfunctions
list— List all Step Functions state machinesdescribe— Get detailed information about a state machineexecute— Start an execution of a state machinelist-executions— List executions of a state machinelogs— Show CloudWatch logs for an execution
trusted-advisor
check-level— Check AWS support level using different methodsseverity-levels— List available support severity levelscases— List AWS support casesservices— List AWS services available for support casescost-savings— Analyze Trusted Advisor cost optimization opportunities
waf
list— List all Web ACLs in the accountstats— Get comprehensive WAF statistics for troubleshootingtroubleshoot— Generate a comprehensive WAF troubleshooting report
Configuration
Create a .env file in your project directory or home directory:
AWS_PROFILE=default
AWS_DEFAULT_REGION=us-east-1
AWS_OUTPUT_FORMAT=table
WORKERS=4
Publishing
This package is published to PyPI as
aws-cloud-utilities. Release
publishing is handled by GitHub Actions through PyPI trusted publishing. See
Publishing to PyPI for the release checklist
and recovery notes.
Development
Setup Development Environment
# Clone the repository
git clone https://github.com/jon-the-dev/aws-cloud-tools.git
cd aws-cloud-tools/v2
# Install in development mode
pip install -e ".[dev]"
# Install pre-commit hooks
pre-commit install
Running Tests
# Run all tests
pytest
# Run with coverage
pytest --cov=aws_cloud_utilities
# Run specific test file
pytest tests/test_cli.py
Code Quality
# Format code
black aws_cloud_utilities tests
# Lint code
flake8 aws_cloud_utilities tests
# Type checking
mypy aws_cloud_utilities
Migration from v1
If you're migrating from the original script collection, see our Migration Guide for detailed instructions.
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
License
MIT License - see LICENSE file for details.
Support
Changelog
See CHANGELOG.md for version history and changes.
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_cloud_utilities-2.1.4.tar.gz.
File metadata
- Download URL: aws_cloud_utilities-2.1.4.tar.gz
- Upload date:
- Size: 148.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
353731d0ffb82090bacfe85c611f645ca8cdcc11f4d84bad8424dece68c55cfc
|
|
| MD5 |
1626394e0ec013753e610a9a2e9ba5b0
|
|
| BLAKE2b-256 |
f9f42a53a84859e08cfa6b9e1e8eed785bc7b57c1453ac1cd457791d25bbd346
|
Provenance
The following attestation bundles were made for aws_cloud_utilities-2.1.4.tar.gz:
Publisher:
publish.yml on jon-the-dev/aws-cloud-tools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aws_cloud_utilities-2.1.4.tar.gz -
Subject digest:
353731d0ffb82090bacfe85c611f645ca8cdcc11f4d84bad8424dece68c55cfc - Sigstore transparency entry: 2354461441
- Sigstore integration time:
-
Permalink:
jon-the-dev/aws-cloud-tools@dd6af27e8fecc4c1ef92cc4921eed3ca8f58d395 -
Branch / Tag:
refs/tags/v2.1.4 - Owner: https://github.com/jon-the-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@dd6af27e8fecc4c1ef92cc4921eed3ca8f58d395 -
Trigger Event:
release
-
Statement type:
File details
Details for the file aws_cloud_utilities-2.1.4-py3-none-any.whl.
File metadata
- Download URL: aws_cloud_utilities-2.1.4-py3-none-any.whl
- Upload date:
- Size: 153.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c935c404589f449fe706742280a0107dbaf78f2e3fa9b71bd6357940ddaf0362
|
|
| MD5 |
813261db157f06618598843edb19d96e
|
|
| BLAKE2b-256 |
cba4ac881c6ce69d385122be88fbc6410e42fdb50abded6da36d79c1fa6e5cef
|
Provenance
The following attestation bundles were made for aws_cloud_utilities-2.1.4-py3-none-any.whl:
Publisher:
publish.yml on jon-the-dev/aws-cloud-tools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aws_cloud_utilities-2.1.4-py3-none-any.whl -
Subject digest:
c935c404589f449fe706742280a0107dbaf78f2e3fa9b71bd6357940ddaf0362 - Sigstore transparency entry: 2354461591
- Sigstore integration time:
-
Permalink:
jon-the-dev/aws-cloud-tools@dd6af27e8fecc4c1ef92cc4921eed3ca8f58d395 -
Branch / Tag:
refs/tags/v2.1.4 - Owner: https://github.com/jon-the-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@dd6af27e8fecc4c1ef92cc4921eed3ca8f58d395 -
Trigger Event:
release
-
Statement type: