Skip to content

Instantly share code, notes, and snippets.

@watchamcb
Created June 16, 2015 15:22
Show Gist options
  • Save watchamcb/fc686c70e8c2660ee7ef to your computer and use it in GitHub Desktop.
Save watchamcb/fc686c70e8c2660ee7ef to your computer and use it in GitHub Desktop.
Auto Scaling replacement of instances terminated in EC2 console
$ aws autoscaling describe-scaling-activities --auto-scaling-group-name web-asg --query 'Activities[*].{Description:Description,StartTime:StartTime,Cause:Cause}'
[
{
"Cause": "At 2015-06-16T14:59:31Z an instance was started in response to a difference between desired and actual capacity, increasing the capacity from 2 to 3.",
"Description": "Launching a new EC2 instance: i-751c4edf",
"StartTime": "2015-06-16T14:59:32.927Z"
},
{
"Cause": "At 2015-06-16T14:59:01Z an instance was taken out of service in response to a EC2 health check indicating it has been terminated or stopped.",
"Description": "Terminating EC2 instance: i-74194bde",
"StartTime": "2015-06-16T14:59:01.757Z"
},
{
"Cause": "At 2015-06-16T14:57:31Z an instance was started in response to a difference between desired and actual capacity, increasing the capacity from 2 to 3.",
"Description": "Launching a new EC2 instance: i-b8ee1641",
"StartTime": "2015-06-16T14:57:33.033Z"
},
{
"Cause": "At 2015-06-16T14:57:01Z an instance was taken out of service in response to a EC2 health check indicating it has been terminated or stopped.",
"Description": "Terminating EC2 instance: i-3deb13c4",
"StartTime": "2015-06-16T14:57:01.157Z"
},
{
"Cause": "At 2015-06-16T14:55:30Z an instance was started in response to a difference between desired and actual capacity, increasing the capacity from 2 to 3.",
"Description": "Launching a new EC2 instance: i-6d4ff8c7",
"StartTime": "2015-06-16T14:55:32.323Z"
},
{
"Cause": "At 2015-06-16T14:55:00Z an instance was taken out of service in response to a EC2 health check indicating it has been terminated or stopped.",
"Description": "Terminating EC2 instance: i-7941f6d3",
"StartTime": "2015-06-16T14:55:00.387Z"
},
{
"Cause": "At 2015-06-16T14:52:25Z a user request created an AutoScalingGroup changing the desired capacity from 0 to 3. At 2015-06-16T14:52:29Z an instance was started in response to a difference between desired and actual capacity, increasing the capacity from 0 to 3.",
"Description": "Launching a new EC2 instance: i-7941f6d3",
"StartTime": "2015-06-16T14:52:31.016Z"
},
{
"Cause": "At 2015-06-16T14:52:25Z a user request created an AutoScalingGroup changing the desired capacity from 0 to 3. At 2015-06-16T14:52:29Z an instance was started in response to a difference between desired and actual capacity, increasing the capacity from 0 to 3.",
"Description": "Launching a new EC2 instance: i-3deb13c4",
"StartTime": "2015-06-16T14:52:30.751Z"
},
{
"Cause": "At 2015-06-16T14:52:25Z a user request created an AutoScalingGroup changing the desired capacity from 0 to 3. At 2015-06-16T14:52:29Z an instance was started in response to a difference between desired and actual capacity, increasing the capacity from 0 to 3.",
"Description": "Launching a new EC2 instance: i-74194bde",
"StartTime": "2015-06-16T14:52:30.721Z"
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment