application-autoscaling-2016-02-06.examples.json
15.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
{
"version": "1.0",
"examples": {
"DeleteScalingPolicy": [
{
"input": {
"PolicyName": "web-app-cpu-lt-25",
"ResourceId": "service/default/web-app",
"ScalableDimension": "ecs:service:DesiredCount",
"ServiceNamespace": "ecs"
},
"output": {
},
"comments": {
"input": {
},
"output": {
}
},
"description": "This example deletes a scaling policy for the Amazon ECS service called web-app, which is running in the default cluster.",
"id": "to-delete-a-scaling-policy-1470863892689",
"title": "To delete a scaling policy"
}
],
"DeregisterScalableTarget": [
{
"input": {
"ResourceId": "service/default/web-app",
"ScalableDimension": "ecs:service:DesiredCount",
"ServiceNamespace": "ecs"
},
"output": {
},
"comments": {
"input": {
},
"output": {
}
},
"description": "This example deregisters a scalable target for an Amazon ECS service called web-app that is running in the default cluster.",
"id": "to-deregister-a-scalable-target-1470864164895",
"title": "To deregister a scalable target"
}
],
"DescribeScalableTargets": [
{
"input": {
"ServiceNamespace": "ecs"
},
"output": {
"ScalableTargets": [
{
"CreationTime": "2016-05-06T11:21:46.199Z",
"MaxCapacity": 10,
"MinCapacity": 1,
"ResourceId": "service/default/web-app",
"RoleARN": "arn:aws:iam::012345678910:role/aws-service-role/ecs.application-autoscaling.amazonaws.com/AWSServiceRoleForApplicationAutoScaling_ECSService",
"ScalableDimension": "ecs:service:DesiredCount",
"ServiceNamespace": "ecs",
"SuspendedState": {
"DynamicScalingInSuspended": false,
"DynamicScalingOutSuspended": false,
"ScheduledScalingSuspended": false
}
}
]
},
"comments": {
"input": {
},
"output": {
}
},
"description": "This example describes the scalable targets for the ecs service namespace.",
"id": "to-describe-scalable-targets-1470864286961",
"title": "To describe scalable targets"
}
],
"DescribeScalingActivities": [
{
"input": {
"ResourceId": "service/default/web-app",
"ScalableDimension": "ecs:service:DesiredCount",
"ServiceNamespace": "ecs"
},
"output": {
"ScalingActivities": [
{
"ActivityId": "e6c5f7d1-dbbb-4a3f-89b2-51f33e766399",
"Cause": "monitor alarm web-app-cpu-lt-25 in state ALARM triggered policy web-app-cpu-lt-25",
"Description": "Setting desired count to 1.",
"EndTime": "2016-05-06T16:04:32.111Z",
"ResourceId": "service/default/web-app",
"ScalableDimension": "ecs:service:DesiredCount",
"ServiceNamespace": "ecs",
"StartTime": "2016-05-06T16:03:58.171Z",
"StatusCode": "Successful",
"StatusMessage": "Successfully set desired count to 1. Change successfully fulfilled by ecs."
}
]
},
"comments": {
"input": {
},
"output": {
}
},
"description": "This example describes the scaling activities for an Amazon ECS service called web-app that is running in the default cluster.",
"id": "to-describe-scaling-activities-for-a-scalable-target-1470864398629",
"title": "To describe scaling activities for a scalable target"
}
],
"DescribeScalingPolicies": [
{
"input": {
"ServiceNamespace": "ecs"
},
"output": {
"NextToken": "",
"ScalingPolicies": [
{
"Alarms": [
{
"AlarmARN": "arn:aws:cloudwatch:us-west-2:012345678910:alarm:web-app-cpu-gt-75",
"AlarmName": "web-app-cpu-gt-75"
}
],
"CreationTime": "2016-05-06T12:11:39.230Z",
"PolicyARN": "arn:aws:autoscaling:us-west-2:012345678910:scalingPolicy:6d8972f3-efc8-437c-92d1-6270f29a66e7:resource/ecs/service/default/web-app:policyName/web-app-cpu-gt-75",
"PolicyName": "web-app-cpu-gt-75",
"PolicyType": "StepScaling",
"ResourceId": "service/default/web-app",
"ScalableDimension": "ecs:service:DesiredCount",
"ServiceNamespace": "ecs",
"StepScalingPolicyConfiguration": {
"AdjustmentType": "PercentChangeInCapacity",
"Cooldown": 60,
"StepAdjustments": [
{
"MetricIntervalLowerBound": 0,
"ScalingAdjustment": 200
}
]
}
}
]
},
"comments": {
"input": {
},
"output": {
}
},
"description": "This example describes the scaling policies for the ecs service namespace.",
"id": "to-describe-scaling-policies-1470864609734",
"title": "To describe scaling policies"
}
],
"PutScalingPolicy": [
{
"input": {
"PolicyName": "cpu75-target-tracking-scaling-policy",
"PolicyType": "TargetTrackingScaling",
"ResourceId": "service/default/web-app",
"ScalableDimension": "ecs:service:DesiredCount",
"ServiceNamespace": "ecs",
"TargetTrackingScalingPolicyConfiguration": {
"PredefinedMetricSpecification": {
"PredefinedMetricType": "ECSServiceAverageCPUUtilization"
},
"ScaleInCooldown": 60,
"ScaleOutCooldown": 60,
"TargetValue": 75
}
},
"output": {
"Alarms": [
{
"AlarmARN": "arn:aws:cloudwatch:us-west-2:012345678910:alarm:TargetTracking-service/default/web-app-AlarmHigh-d4f0770c-b46e-434a-a60f-3b36d653feca",
"AlarmName": "TargetTracking-service/default/web-app-AlarmHigh-d4f0770c-b46e-434a-a60f-3b36d653feca"
},
{
"AlarmARN": "arn:aws:cloudwatch:us-west-2:012345678910:alarm:TargetTracking-service/default/web-app-AlarmLow-1b437334-d19b-4a63-a812-6c67aaf2910d",
"AlarmName": "TargetTracking-service/default/web-app-AlarmLow-1b437334-d19b-4a63-a812-6c67aaf2910d"
}
],
"PolicyARN": "arn:aws:autoscaling:us-west-2:012345678910:scalingPolicy:6d8972f3-efc8-437c-92d1-6270f29a66e7:resource/ecs/service/default/web-app:policyName/cpu75-target-tracking-scaling-policy"
},
"comments": {
"input": {
},
"output": {
}
},
"description": "The following example applies a target tracking scaling policy with a predefined metric specification to an Amazon ECS service called web-app in the default cluster. The policy keeps the average CPU utilization of the service at 75 percent, with scale-out and scale-in cooldown periods of 60 seconds.",
"id": "to-apply-a-target-tracking-scaling-policy-with-a-predefined-metric-specification-1569364247984",
"title": "To apply a target tracking scaling policy with a predefined metric specification"
},
{
"input": {
"PolicyName": "cms75-target-tracking-scaling-policy",
"PolicyType": "TargetTrackingScaling",
"ResourceId": "service/default/web-app",
"ScalableDimension": "ecs:service:DesiredCount",
"ServiceNamespace": "ecs",
"TargetTrackingScalingPolicyConfiguration": {
"CustomizedMetricSpecification": {
"Dimensions": [
{
"Name": "MyOptionalMetricDimensionName",
"Value": "MyOptionalMetricDimensionValue"
}
],
"MetricName": "MyUtilizationMetric",
"Namespace": "MyNamespace",
"Statistic": "Average",
"Unit": "Percent"
},
"ScaleInCooldown": 60,
"ScaleOutCooldown": 60,
"TargetValue": 75
}
},
"output": {
"Alarms": [
{
"AlarmARN": "arn:aws:cloudwatch:us-west-2:012345678910:alarm:TargetTracking-service/default/web-app-AlarmHigh-9bc77b56-0571-4276-ba0f-d4178882e0a0",
"AlarmName": "TargetTracking-service/default/web-app-AlarmHigh-9bc77b56-0571-4276-ba0f-d4178882e0a0"
},
{
"AlarmARN": "arn:aws:cloudwatch:us-west-2:012345678910:alarm:TargetTracking-service/default/web-app-AlarmLow-9b6ad934-6d37-438e-9e05-02836ddcbdc4",
"AlarmName": "TargetTracking-service/default/web-app-AlarmLow-9b6ad934-6d37-438e-9e05-02836ddcbdc4"
}
],
"PolicyARN": "arn:aws:autoscaling:us-west-2:012345678910:scalingPolicy: 8784a896-b2ba-47a1-b08c-27301cc499a1:resource/ecs/service/default/web-app:policyName/cms75-target-tracking-scaling-policy"
},
"comments": {
"input": {
},
"output": {
}
},
"description": "The following example applies a target tracking scaling policy with a customized metric specification to an Amazon ECS service called web-app in the default cluster. The policy keeps the average utilization of the service at 75 percent, with scale-out and scale-in cooldown periods of 60 seconds. ",
"id": "to-apply-a-target-tracking-scaling-policy-with-a-customized-metric-specification-1569365036205",
"title": "To apply a target tracking scaling policy with a customized metric specification"
},
{
"input": {
"PolicyName": "alb-scale-out-target-tracking-scaling-policy",
"PolicyType": "TargetTrackingScaling",
"ResourceId": "service/default/web-app",
"ScalableDimension": "ecs:service:DesiredCount",
"ServiceNamespace": "ecs",
"TargetTrackingScalingPolicyConfiguration": {
"DisableScaleIn": true,
"PredefinedMetricSpecification": {
"PredefinedMetricType": "ALBRequestCountPerTarget",
"ResourceLabel": "app/EC2Co-EcsEl-1TKLTMITMM0EO/f37c06a68c1748aa/targetgroup/EC2Co-Defau-LDNM7Q3ZH1ZN/6d4ea56ca2d6a18d"
},
"ScaleInCooldown": 60,
"ScaleOutCooldown": 60,
"TargetValue": 1000
}
},
"output": {
"Alarms": [
{
"AlarmARN": "TargetTracking-service/default/web-app-AlarmHigh-d4f0770c-b46e-434a-a60f-3b36d653feca",
"AlarmName": "arn:aws:cloudwatch:us-west-2:012345678910:alarm:TargetTracking-service/default/web-app-AlarmHigh-d4f0770c-b46e-434a-a60f-3b36d653feca"
}
],
"PolicyARN": "arn:aws:autoscaling:us-west-2:012345678910:scalingPolicy:6d8972f3-efc8-437c-92d1-6270f29a66e7:resource/ecs/service/default/web-app:policyName/alb-scale-out-target-tracking-scaling-policy"
},
"comments": {
"input": {
},
"output": {
}
},
"description": "The following example applies a target tracking scaling policy to an Amazon ECS service called web-app in the default cluster. The policy is used to scale out the ECS service when the RequestCountPerTarget metric from the Application Load Balancer exceeds the threshold.",
"id": "to-apply-a-target-tracking-scaling-policy-for-scale-out-only-1569366080118",
"title": "To apply a target tracking scaling policy for scale out only"
},
{
"input": {
"PolicyName": "web-app-cpu-gt-75",
"PolicyType": "StepScaling",
"ResourceId": "service/default/web-app",
"ScalableDimension": "ecs:service:DesiredCount",
"ServiceNamespace": "ecs",
"StepScalingPolicyConfiguration": {
"AdjustmentType": "PercentChangeInCapacity",
"Cooldown": 60,
"StepAdjustments": [
{
"MetricIntervalLowerBound": 0,
"ScalingAdjustment": 200
}
]
}
},
"output": {
"PolicyARN": "arn:aws:autoscaling:us-west-2:012345678910:scalingPolicy:6d8972f3-efc8-437c-92d1-6270f29a66e7:resource/ecs/service/default/web-app:policyName/web-app-cpu-gt-75"
},
"comments": {
"input": {
},
"output": {
}
},
"description": "This example applies a step scaling policy to an Amazon ECS service called web-app in the default cluster. The policy increases the desired count of the service by 200%, with a cool down period of 60 seconds.",
"id": "to-apply-a-step-scaling-policy-to-an-amazon-ecs-service-1470864779862",
"title": "To apply a step scaling policy to an Amazon ECS service"
},
{
"input": {
"PolicyName": "fleet-cpu-gt-75",
"PolicyType": "StepScaling",
"ResourceId": "spot-fleet-request/sfr-45e69d8a-be48-4539-bbf3-3464e99c50c3",
"ScalableDimension": "ec2:spot-fleet-request:TargetCapacity",
"ServiceNamespace": "ec2",
"StepScalingPolicyConfiguration": {
"AdjustmentType": "PercentChangeInCapacity",
"Cooldown": 180,
"StepAdjustments": [
{
"MetricIntervalLowerBound": 0,
"ScalingAdjustment": 200
}
]
}
},
"output": {
"PolicyARN": "arn:aws:autoscaling:us-east-1:012345678910:scalingPolicy:89406401-0cb7-4130-b770-d97cca0e446b:resource/ec2/spot-fleet-request/sfr-45e69d8a-be48-4539-bbf3-3464e99c50c3:policyName/fleet-cpu-gt-75"
},
"comments": {
"input": {
},
"output": {
}
},
"description": "This example applies a step scaling policy to an Amazon EC2 Spot fleet. The policy increases the target capacity of the spot fleet by 200%, with a cool down period of 180 seconds.\",\n ",
"id": "to-apply-a-step-scaling-policy-to-an-amazon-ec2-spot-fleet-1472073278469",
"title": "To apply a step scaling policy to an Amazon EC2 Spot fleet"
}
],
"RegisterScalableTarget": [
{
"input": {
"MaxCapacity": 10,
"MinCapacity": 1,
"ResourceId": "service/default/web-app",
"ScalableDimension": "ecs:service:DesiredCount",
"ServiceNamespace": "ecs"
},
"comments": {
"input": {
},
"output": {
}
},
"description": "This example registers a scalable target from an Amazon ECS service called web-app that is running on the default cluster, with a minimum desired count of 1 task and a maximum desired count of 10 tasks.",
"id": "to-register-a-new-scalable-target-1470864910380",
"title": "To register an ECS service as a scalable target"
},
{
"input": {
"MaxCapacity": 10,
"MinCapacity": 1,
"ResourceId": "spot-fleet-request/sfr-45e69d8a-be48-4539-bbf3-3464e99c50c3",
"ScalableDimension": "ec2:spot-fleet-request:TargetCapacity",
"ServiceNamespace": "ec2"
},
"output": {
},
"comments": {
},
"description": "This example registers a scalable target from an Amazon EC2 Spot fleet with a minimum target capacity of 1 and a maximum of 10.",
"id": "to-register-an-ec2-spot-fleet-as-a-scalable-target-1472072899649",
"title": "To register an EC2 Spot fleet as a scalable target"
}
]
}
}