Skip to content

Latest commit

 

History

History
49 lines (39 loc) · 1.36 KB

ecs_autoscaling.md

File metadata and controls

49 lines (39 loc) · 1.36 KB

Register service as a scalable target

aws application-autoscaling register-scalable-target --cli-input-json file://aws/autoscale/dev/scalable-target.json

Assign policies for memory and CPU

After executing command save PolicyARN from output for setting up alarms later

  • Memory scale out
aws application-autoscaling put-scaling-policy --cli-input-json file://aws/autoscale/dev/memory/scale-out.json
  • Memory scale down
aws application-autoscaling put-scaling-policy --cli-input-json file://aws/autoscale/dev/memory/scale-down.json
  • CPU scale out
aws application-autoscaling put-scaling-policy --cli-input-json file://aws/autoscale/dev/cpu/scale-out.json
  • CPU scale down
aws application-autoscaling put-scaling-policy --cli-input-json file://aws/autoscale/dev/cpu/scale-down.json

Register alarms on CloudWatch

  • Memory scale out
aws cloudwatch put-metric-alarm --cli-input-json file://aws/autoscale/dev/memory/alarm-scale-out.json
  • Memory scale down
aws cloudwatch put-metric-alarm --cli-input-json file://aws/autoscale/dev/memory/alarm-scale-down.json
  • CPU scale out
aws cloudwatch put-metric-alarm --cli-input-json file://aws/autoscale/dev/cpu/alarm-scale-out.json
  • CPU scale down
aws cloudwatch put-metric-alarm --cli-input-json file://aws/autoscale/dev/cpu/alarm-scale-down.json