AWS EC2 Auto Scaling Groups: I get Min and Max, but what’s Desired instances limit for?

Here are the explanations for the “min, desired and max” values from AWS support: MIN: This will be the minimum number of instances that can run in your auto scale group. If your scale down CloudWatch alarm is triggered, your auto scale group will never terminate instances below this number DESIRED: If you trip a … Read more

EC2 Auto-Scaling with Spot and On-Demand Instances?

At the moment you can mix ondemand and spot instances across single ASG Amazon EC2 Auto Scaling now lets you provision and automatically scale instances across purchase options, Availability Zones (AZ), and instance families in a single Auto Scaling group (ASG), to optimize scale, performance, and cost. Now you can include Spot Instances with On-Demand … Read more

How to automatically update nginx upstream server list when aws ec2 hostname changes or increases?

This can be achieved by using Amazon SDK ( I am almost done with it, will put it on github ), utilizing the SNS, EC2 and Autoscaling service. I have followed the below steps to achieve this: Enable HTTP notification and subscribed my webserver. Added a lifecycle-hook with heartbeat of 1 min (to wait for … Read more

How can I automatically cycle a new image in an AWS Auto Scaling Group?

I’d like to suggest “AWS-HA-Release” to do this – the way AWS-HA-Release works: If the current autoscaling group and ELB report 5 instances that are healthy, AWS-HA-Release brings a new instance into production and waits for the ELB to identify it as healthy (bring the total number of healthy instances to 6) Removes an old … Read more

How to get Autoscaling group Instances IP adresses

I have written a small script like below to get the IP list: #!/bin/bash for i in `aws autoscaling describe-auto-scaling-groups –auto-scaling-group-name ASGName | grep -i instanceid | awk ‘{ print $2}’ | cut -d’,’ -f1| sed -e ‘s/”//g’` do aws ec2 describe-instances –instance-ids $i | grep -i PrivateIpAddress | awk ‘{ print $2 }’ | … Read more

Static IP address for outgoing traffic from AWS autoscaling group

You need a NAT. This configuration is commonly used to support private subnets in VPC, there’s quite a detailed guide here. Once your VPC is configured to use the NAT instance all the outbound traffic will be attributed to the EIP of the NAT instance. If so, does that instance need to be solely for … Read more