This repository contains scripts for AWS Developers, DevOps Engineers, and Cloud Architects. Tools focus on task automation and infrastructure management.
Tip
Towards the Cloud is an AWS cloud consultancy for startups and growing companies. We provide managed services that help you build faster, optimize costs, and maintain control over security and compliance as you scale on AWS Cloud.
Not sure where your AWS setup stands? Get a free assessment with detailed security findings and cost optimization opportunities. You will see exactly what needs fixingβhandle it yourself or let us help. No strings attached.
How our managed service works
AWS is easy to start with, but without proper guardrails and Infrastructure as Code, complexity compounds monthly. The longer you wait, the more expensive and risky the fix becomes.
You're experiencing:
- Rising AWS bills β inefficient architectures costing 40-60% more than necessary
- Lost visibility β security vulnerabilities and compliance gaps you don't know about yet
- Team bottlenecks β engineers stuck firefighting infrastructure instead of shipping product
Traditional consultancies leave you with infrastructure you can't maintain. We provide ongoing managed services so you understand and control your AWS environment.
- β Compliant multi-account Landing Zone β Start 100% CIS benchmark compliant with built-in security guardrails, SSO, and AWS CDK
- β Pre-built secure CDK components β Use our production-ready infrastructure patterns instead of building from scratch
- β Complete CI/CD with rollbacks β Deploy confidently with Infrastructure as Code safety nets
- β Quarterly reviews β Proactive cost optimization and security assessments to prevent issues before they happen
- β Fractional Cloud Engineer β On-demand access to expert AWS guidance when you need it
- 30-60% lower AWS costs β Documented savings through proactive optimization (see case study)
- Faster compliance certification β 100% CIS-compliant foundation accelerates SOC 2/HIPAA
- Smooth yearly audits β Automated monitoring and quarterly security reviews keep you audit-ready
- Team focuses on product β Pre-built secure components eliminate AWS infrastructure work
- No full-time hire needed β Expert cloud guidance through flexible retainer
Testimonial: Y Combinator startup Accolade's founder on how our Landing Zone accelerated their SOC 2 certification:
"Danny's solution and AWS expertise stood out with comprehensive accelerators, documentation, and clearly articulated design principles. We achieved a perfect security score in days, not months." β Galen Simmons, CEO
Navigate to the relevant AWS service section. Click on the script name in the table below to open the content and usage instructions.
This collection includes Python and Bash scripts for managing various AWS services. The scripts are organized by service for easy navigation.
| Category | Script Name | Description |
|---|---|---|
| AppStream | appstream_delete_image.py | Unshares AppStream image, then deletes it |
| CloudFormation | cfn_delete_stackset.py | Deletes stackset and associated instances |
| CloudWatch | cw_count_log_groups.py | Counts the total number of CloudWatch log groups in an AWS account |
| CloudWatch | cw_delete_log_groups.py | Deletes log groups based on age |
| CloudWatch | cw_fetch_log_groups_with_creation_date.py | Fetches log groups with creation date |
| CloudWatch | cw_set_retention_policy.py | Sets retention policy for log groups |
| CodePipeline | cp_slack_notifications.py | Enables notifications on Slack |
| EC2 | ec2_delete_unattached_volumes.py | Deletes unattached EBS volumes |
| EC2 | ec2_delete_orphaned_snapshots.py | Deletes snapshots that are not associated with any volumes |
| EC2 | ec2_delete_old_amis.py | Deletes old AMIs and associated snapshots based on age |
| EC2 | ec2_delete_ssh_access_security_groups.py | Deletes SSH (port 22) inbound rules from all security groups |
| EC2 | ec2_delete_unused_amis.py | Deletes unused AMIs (Amazon Machine Images) in an AWS account |
| EC2 | ec2_delete_unused_eips.py | Deletes unused Elastic IPs |
| EC2 | ec2_delete_unused_keypairs_all_regions.py | Deletes unused EC2 keypairs in all regions |
| EC2 | ec2_delete_unused_keypairs_single_region.py | Deletes unused EC2 keypairs in a single region |
| EC2 | ec2_delete_tagged_security_groups.py | Deletes tagged security groups |
| EC2 | ec2_find_unattached_volumes.py | Finds unattached EBS volumes |
| EC2 | ec2_asg_ssh.sh | SSH wrapper for Auto Scaling group instances |
| EC2 | ec2_list_available_eips.sh | Lists unassociated Elastic IPs |
| EC2 | ec2_request_spot_instances.sh | Requests spot instances |
| EC2 | ec2_resize_volume.sh | Resizes EBS volume |
| ECS | ecs_delete_inactive_task_definitions.py | Deletes inactive ECS task definitions |
| ECS | ecs_publish_ecr_image.sh | Publishes Docker image to ECR |
| EFS | efs_delete_tagged_filesystems.py | Deletes tagged EFS and mount targets |
| IAM | iam_delete_user.py | Deletes IAM users |
| IAM | iam_identity_center_create_users.py | Create IAM Identity Center (SSO) users |
| IAM | iam_rotate_access_keys.py | Rotates IAM user keys |
| IAM | iam_assume_role.sh | Assumes IAM role |
| Organizations | org_assign_sso_access_by_ou.py | Assigns SSO access for accounts in an OU |
| Organizations | org_import_users_to_sso.py | Imports users/groups to AWS SSO |
| Organizations | org_list_accounts_by_ou.py | Lists accounts in an OU |
| Organizations | org_list_sso_assignments.py | Lists SSO assignments for accounts |
| Organizations | org_remove_sso_access_by_ou.py | Removes SSO access for accounts in an OU |
| S3 | s3_create_tar.py | Creates tar files |
| S3 | s3_delete_empty_buckets.py | Deletes empty S3 buckets |
| S3 | s3_list_old_files.py | Lists old files in S3 |
| S3 | s3_search_bucket_and_delete.py | Deletes S3 bucket and its contents |
| S3 | s3_search_bucket_and_download.py | Finds S3 bucket and download all its content |
| S3 | s3_search_file.py | Searches for files in S3 bucket |
| S3 | s3_search_key.py | Searches for a key in S3 bucket |
| S3 | s3_search_multiple_keys.py | Searches for multiple keys in S3 bucket |
| S3 | s3_search_subdirectory.py | Searches subdirectories in S3 |
| SageMaker | sm_cleanup_spaces.py | Interactive tool to list and delete SageMaker Studio spaces |
| SageMaker | sm_delete_user_profile.py | Deletes SageMaker user profiles and their dependencies |
| SSM | ssm_delete_parameters.sh | Deletes SSM parameters |
| SSM | ssm_import_parameters.sh | Imports SSM parameters |
| General | delete_unused_security_groups.py | Deletes unused security groups |
| General | aws_cli_aliases.sh | AWS CLI command aliases |
| General | tag_secrets_manager_secrets.py | Tags Secrets Manager secrets |
| General | set-alternate-contact.py | Sets alternate contacts for all accounts in an organization |
| General | multi_account_command_executor.py | Runs commands across multiple AWS accounts |
This section lists tools that enhance AWS usage across console, CLI, and APIs.
- AutoSpotting - Open-source spot market automation tool for easy adoption at scale.
- Awesome ECS - Curated list of ECS guides and resources.
- AWS Copilot CLI - CLI for building and operating containerized applications on ECS and Fargate.
- ECS Compose-X - Tool to generate CFN templates from docker-compose files with added AWS resource definitions.
- AWS IAM Actions - Comprehensive IAM action listing and policy generator.
- IAM Floyd - Fluent interface for IAM policy statement generation.
- AWS CDK Starterkit - Rapid AWS CDK app deployment via GitHub actions.
- AWS CloudFormation Starterkit - Rapid AWS CloudFormation stack deployment via GitHub actions.
- Awesome CDK - Curated list of AWS CDK resources.
- Awesome CloudFormation - Curated CloudFormation resources.
- Awesome Terraform - Curated Terraform resources.
- Former2 - Template generator from existing AWS resources.
- Open CDK Guide - Opinionated AWS CDK best practices guide.
- VSCode IAM Actions Snippets - Adds autocompletion in VS Code for AWS IAM policy actions.
- VSCode IAM Service Principal Snippets - Adds autocompletion in VS Code for AWS service principals.
- VSCode CDK Snippets - VS Code extension for CDK construct snippets.
- VSCode CloudFormation Snippets - VS Code extension for CloudFormation resource snippets.
- VSCode SAM Snippets - VS Code extension for CloudFormation resource snippets.
- AWS Lambda Power Tuning - Step Functions-based Lambda optimization tool.
- Serverless Cost Calculator Comparison - Cost comparison tool for serverless functions across cloud providers.
- Serverless Cost Calculator - AWS Lambda cost estimation tool.
- s3s3mirror - High-performance S3 bucket mirroring utility.
- Leapp - Cross-platform AWS programmatic access manager.
- Prowler - Open-source security assessment and auditing tool.
- AWS Security Tools - Curated list of AWS security tools.
- aws-gate - Enhanced AWS SSM Session Manager CLI.
- aws-ssm-ec2-proxy-command - SSH to EC2 via SSM without open ports.
- ssm-supercharged - SSM integration with OpenSSH, EC2 Instance Connect, and sshuttle.
- Cloud Custodian - Cloud governance platform for AWS.
- Service Screener - Tool to evaluate your AWS service configurations based on AWS and community best practices.
- Steampipe - SQL-like querying for AWS resources.
- AWS Nuke - AWS account resource removal tool.
This project exists thanks to all the people who contribute.
See how you can contribute to this repository.