Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #
- # Note that this requires the really cool command-line tool 'jq'
- #
- if [ -z "$1" ]; then
- echo "as_kill_instances [group]"
- exit -1
- fi
- instances=$(aws autoscaling describe-auto-scaling-groups --auto-scaling-group-names $1 | jq -r .AutoScalingGroups[0].Instances[].InstanceId )
- for instance in $instances ; do
- aws autoscaling terminate-instance-in-auto-scaling-group \
- --instance-id $instance \
- --no-should-decrement-desired-capacity
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement