Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save quiver/fca4dc97d7d5be04cf79 to your computer and use it in GitHub Desktop.
Save quiver/fca4dc97d7d5be04cf79 to your computer and use it in GitHub Desktop.
aws : autoscaling waiters based on aws/aws-sdk-ruby
{
"AutoScalingGroups": [
{
"AutoScalingGroupARN": "arn:aws:autoscaling:ap-northeast-1:123456789012:autoScalingGroup:aaaaaaaa-35cb-4f11-bf21-258b69e3c42d:autoScalingGroupName/bar",
"HealthCheckGracePeriod": 300,
"SuspendedProcesses": [],
"DesiredCapacity": 0,
"Tags": [],
"EnabledMetrics": [],
"LoadBalancerNames": [],
"AutoScalingGroupName": "bar",
"DefaultCooldown": 300,
"MinSize": 1,
"Instances": [],
"MaxSize": 3,
"VPCZoneIdentifier": "subnet-12345678",
"TerminationPolicies": [
"Default"
],
"LaunchConfigurationName": "my-first-lc",
"CreatedTime": "2016-02-28T16:35:44.252Z",
"AvailabilityZones": [
"ap-northeast-1a"
],
"HealthCheckType": "EC2",
"NewInstancesProtectedFromScaleIn": false
},
{
"AutoScalingGroupARN": "arn:aws:autoscaling:ap-northeast-1:123456789012:autoScalingGroup:ca0b9366-c634-4957-96c1-7339ef423559:autoScalingGroupName/foo",
"HealthCheckGracePeriod": 300,
"SuspendedProcesses": [],
"DesiredCapacity": 2,
"Tags": [],
"EnabledMetrics": [],
"LoadBalancerNames": [
"green"
],
"AutoScalingGroupName": "foo",
"DefaultCooldown": 300,
"MinSize": 1,
"Instances": [
{
"ProtectedFromScaleIn": false,
"AvailabilityZone": "ap-northeast-1a",
"InstanceId": "i-2fc5d38a",
"HealthStatus": "Healthy",
"LifecycleState": "InService",
"LaunchConfigurationName": "my-first-lc"
},
{
"ProtectedFromScaleIn": false,
"AvailabilityZone": "ap-northeast-1c",
"InstanceId": "i-62d8b9ed",
"HealthStatus": "Healthy",
"LifecycleState": "InService",
"LaunchConfigurationName": "my-first-lc"
}
],
"MaxSize": 5,
"VPCZoneIdentifier": "subnet-12345678",
"TerminationPolicies": [
"Default"
],
"LaunchConfigurationName": "my-first-lc",
"CreatedTime": "2016-02-28T08:40:56.818Z",
"AvailabilityZones": [
"ap-northeast-1c",
"ap-northeast-1a"
],
"HealthCheckType": "EC2",
"NewInstancesProtectedFromScaleIn": false
}
]
}
{
"version": 2,
"waiters": {
"GroupExists": {
"acceptors": [
{
"argument": "length(AutoScalingGroups)",
"expected": 1,
"matcher": "path",
"state": "success"
}
],
"delay": 5,
"maxAttempts": 10,
"operation": "DescribeAutoScalingGroups"
},
"GroupInService": {
"acceptors": [
{
"argument": "AutoScalingGroups[].[length(Instances[?LifecycleState=='InService']) >= MinSize][]",
"expected": true,
"matcher": "pathAll",
"state": "success"
}
],
"delay": 15,
"maxAttempts": 40,
"operation": "DescribeAutoScalingGroups"
},
"GroupNotExists": {
"acceptors": [
{
"argument": "length(AutoScalingGroups)",
"expected": 0,
"matcher": "path",
"state": "success"
}
],
"delay": 15,
"maxAttempts": 40,
"operation": "DescribeAutoScalingGroups"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment