This utility suspends or resumes AWS Autoscaling groups.
This utility provides Autoscaling suspend/resume functionality unavailable in the AWS console or directly via the AWS CLI API.
This utility can:
- Suspend or resume one Autoscaling Group
- Suspend or resume a set of like-named Autoscaling Groups
- Suspend or resume all Autoscaling Groups
This utility produces a summary report listing the suspended/resumed Autoscaling Groups.
- Instantiate a local or EC2 Linux instance
- Install or update the AWS CLI utilities
- The AWS CLI utilities are pre-installed on AWS EC2 Linux instances
- To update on an AWS EC2 instance:
$ sudo pip install --upgrade awscli
- Create an AWS CLI named profile that includes the required IAM permissions
- See the "Prerequisites" section for the required IAM permissions
- To create an AWS CLI named profile:
$ aws configure --profile MyProfileName
- AWS CLI named profile documentation is here: Named Profiles
- Install the bash shell
- The bash shell is included in most distributions and is pre-installed on AWS EC2 Linux instances
- Install jq
- To install jq on AWS EC2:
$ sudo yum install jq -y
- To install jq on AWS EC2:
- Download this utility script or create a local copy and run it on the local or EC2 Linux instance
- Example:
$ bash ./aws-asg-suspend-resume.sh -a s -n all -p MyProfileName
- Example:
- bash - Linux shell
- jq - JSON wrangler
- AWS CLI - command line utilities (pre-installed on AWS AMIs)
- AWS CLI profile with IAM permissions for the following AWS CLI commands:
- autoscaling describe-auto-scaling-groups
- autoscaling suspend-processes
- autoscaling resume-processes
- sts get-caller-identity (used to pull the AWS account number for the report)
To execute the utility:
- Example:
$ bash ./aws-asg-suspend-resume.sh
To directly execute the utility:
- Set the execute flag:
$ chmod +x aws-asg-suspend-resume.sh
- Execute the utility
- Example:
$ ./aws-asg-suspend-resume.sh -a s -n all -p MyProfileName
- Example:
- Summary report
- Debug log (execute with the
-g y
parameter)- Example:
$ bash ./aws-asg-suspend-resume.sh -a s -n all -p MyProfileName -g y
- Example:
- Console verbose mode (execute with the
-b y
parameter)- Example:
$ bash ./aws-asg-suspend-resume.sh -a s -n all -p MyProfileName -b y
- Example:
Please read CONTRIBUTING.md for the process for submitting pull requests to us.
We use SemVer for versioning.
- Douglas Hackney - dhackney
This project is licensed under the MIT License - see the LICENSE.md file for details
- Progress bar
- Dynamic headers fprint
- Menu
- Countless other jq and bash/shell man pages, Q&A, posts, examples, tutorials, etc. from various sources