Skip to content

Instantly share code, notes, and snippets.

@dsalazar32
Created March 8, 2012 21:50
Show Gist options
  • Save dsalazar32/2003686 to your computer and use it in GitHub Desktop.
Save dsalazar32/2003686 to your computer and use it in GitHub Desktop.
AWS Auto-Scaling procedure
Just a few steps in order to autoscale your application...
In this example an autoscaling policy was created for www.altaconfidelidad.com "alta"
Current infrastructure for alta contains:
1 micro ec2 instance
1 load balancer
1 EBS volume attached for persistant storage
Requirements:
Amazon EC2 cli tools
Amazon AS cli tools
Step 1. Launch Config
as-create-launch-config <launch-config-name> --image-id <snap-ami-id> --instance-type m1.large --block-device-mapping '/dev/sdf=<snap-vol-id>:true' --region us-east-1 --group <sec-group>
Step 2. Autoscale Group
as-create-auto-scaling-group <group-name> --launch-configuration <launch-config-name> --availability-zones us-east-1b --min-size 0 --max-size 2 --load-balancers <loadbalancer-name> --region us-east-1
Step 3. Scaling Policies
as-put-scaling-policy <policy-name-up> --auto-scaling-group <group-name> --adjustment=1 --type ChangeInCapacity --cooldown 300 --region us-east-1
as-put-scaling-policy <policy-name-down> --auto-scaling-group <group-name> --adjustment=-1 --type ChangeInCapacity --cooldown 300 --region us-east-1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment