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