Created
May 16, 2018 19:01
-
-
Save fabioluciano/384619fe7abdcbf79e0539916cb99177 to your computer and use it in GitHub Desktop.
Terminate all instances in ScalingGroups
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
client = boto3.client('autoscaling') | |
scaling_groups = client.describe_auto_scaling_groups() | |
for scaling_group in scaling_groups['AutoScalingGroups']: | |
print(scaling_group['AutoScalingGroupName']) | |
client.update_auto_scaling_group( | |
AutoScalingGroupName = scaling_group['AutoScalingGroupName'], | |
MinSize=0, | |
DesiredCapacity = 0 | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment