Created
June 22, 2015 13:29
-
-
Save watchamcb/cf6e8e4a03f204fe9fe4 to your computer and use it in GitHub Desktop.
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
$ for name in \ | |
> $(aws autoscaling describe-auto-scaling-groups --auto-scaling-group-names vpc-web-asg --query 'AutoScalingGroups[*].Instances[*].{instance:InstanceId}' --output text); \ | |
> do \ | |
> aws autoscaling terminate-instance-in-auto-scaling-group --instance-id $name --no-should-decrement-desired-capacity;\ | |
> done | |
{ | |
"Activity": { | |
"Description": "Terminating EC2 instance: i-0c48b6df", | |
"ActivityId": "aad0f260-dbd1-42c0-9320-7f1b07ff1a23", | |
"Details": "{\"Availability Zone\":\"us-east-1b\",\"Subnet ID\":\"subnet-67f89410\"}", | |
"StartTime": "2015-06-22T13:24:25.454Z", | |
"Progress": 0, | |
"Cause": "At 2015-06-22T13:24:25Z instance i-0c48b6df was taken out of service in response to a user request.", | |
"StatusCode": "InProgress" | |
} | |
} | |
{ | |
"Activity": { | |
"Description": "Terminating EC2 instance: i-147564eb", | |
"ActivityId": "275ff164-e430-4259-80d3-89cc1b0674d3", | |
"Details": "{\"Availability Zone\":\"us-east-1c\",\"Subnet ID\":\"subnet-ed0677b4\"}", | |
"StartTime": "2015-06-22T13:24:26.774Z", | |
"Progress": 0, | |
"Cause": "At 2015-06-22T13:24:26Z instance i-147564eb was taken out of service in response to a user request.", | |
"StatusCode": "InProgress" | |
} | |
} | |
{ | |
"Activity": { | |
"Description": "Terminating EC2 instance: i-acf15e45", | |
"ActivityId": "d406b4ba-d916-4ea7-a24f-bce910b08794", | |
"Details": "{\"Availability Zone\":\"us-east-1e\",\"Subnet ID\":\"subnet-ccc1ccf6\"}", | |
"StartTime": "2015-06-22T13:24:28.072Z", | |
"Progress": 0, | |
"Cause": "At 2015-06-22T13:24:28Z instance i-acf15e45 was taken out of service in response to a user request.", | |
"StatusCode": "InProgress" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment