Skip to main content

AWS Toolbox

Project description

AWS Toolbox

AWS Toolbox extends the AWS CLI commands with some handy solutions, such as executing a command on every region and resources matching a given pattern.

Installation

pip install aws-toolbox

Usage

DryRun Mode

Every command can be executed in dryrun mode, by adding the option --dryrun. With dryrun mode, the actual AWS operations will be logged but not executed.

For example:

~> aws-toolbox s3 delete-bucket --name "integ-tests-.*" --dryrun
INFO:aws_toolbox.commands.s3.delete_bucket:Deleting Buckets with name pattern integ-tests-.*, dryrun True
INFO:botocore.credentials:Found credentials in shared credentials file: ~/.aws/credentials
INFO:aws_toolbox.commands.s3.delete_bucket:The following 2 buckets would be deleted, but dryrun mode is enabled and nothing will be done: test-1, test-2, test-3

S3

Delete (emptying, if necessary) all buckets whose name matches the provided regular expression:

aws-toolbox s3 delete-bucket \
  --name "cdk-hnb659fds-assets-319414405305-(?\!us-east-1|eu-west-1)"

Secrets Manager

List all secrets whose name and regions match the provided regular expressions:

aws-toolbox secretsmanager list-secrets \
  --region "us-west-.*" \
  --name ".*"

Delete all secrets whose name and regions match the provided regular expressions:

aws-toolbox secretsmanager delete-secrets \
  --region "us-west-.*" \
  --name "Sample.*"

EC2 AMIs

aws-toolbox ec2 delete-ami \
  --region "eu-.*" \
  --owners 319414405305 \
  --name ".*aws-parallelcluster.*" \
  --before 2023-06-01T00:00:00.000Z

EC2 Snapshots

Delete (emptying, if necessary) all snapshots whose name matches the provided regular expression:

aws-toolbox ec2 delete-snapshot \
  --region "eu-.*" \
  --owners 319414405305 \
  --description "Copied for DestinationAmi .*"

CloudFormation Stacks

Delete all stacks whose name and region matches the provided patterns and have been created before given datetime:

aws-toolbox cloudformation delete-stacks \
  --region "us-.*" \
  --name "aws-parallelcluster-3-8-0-amzn2.*" 
  --before 2023-12-01T00:00:00.000Z

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aws-toolbox-0.0.4.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

aws_toolbox-0.0.4-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

Details for the file aws-toolbox-0.0.4.tar.gz.

File metadata

  • Download URL: aws-toolbox-0.0.4.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for aws-toolbox-0.0.4.tar.gz
Algorithm Hash digest
SHA256 6ea7eda2ebfdf21e76de863b7b3af50ce73e4d7a66a7510f9330c06cb7a4db05
MD5 df28e60716a3740aba8ac01fe8d6f471
BLAKE2b-256 5d8607c52adc13a34b9d2c7c80a642da6649d19cd24c13c56b27bcfd34812bec

See more details on using hashes here.

File details

Details for the file aws_toolbox-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: aws_toolbox-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 18.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for aws_toolbox-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0dcfab0dbc0fc91ac426264dc5f719d8fd3e1f0ffccfc6d30f418e051d37e53b
MD5 48d05bc88d45f76b95e223e06455e311
BLAKE2b-256 2246171fa0a506705b381e3574df0fab6e46edac490fe99dec0eea7d5ab85ab7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page