25 votes

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 $...
  • 1,710
22 votes

How to get Autoscaling group Instances IP adresses

As alternative, my version without any jq/awk/sed/cut $ aws autoscaling describe-auto-scaling-instances --region us-east-1 --output text \ --query "AutoScalingInstances[?AutoScalingGroupName=='ASG-...
  • 7,065
16 votes

Static IP address for outgoing traffic from AWS autoscaling group

I understand this is an old thread - for someone who has a similar use-case now, AWS nat-gateway would be a better solution.
15 votes

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

The approach discussed above would be a little messy, and not so flexible. The more canonical approach is to just create 2 ASGs (one for spot, one for on-demand) and then register them both with the ...
  • 270
11 votes
Accepted

AWS Fargate service: scale to zero?

I’m not sure how exactly it would work. When there are no healthy ALB targets the ALB returns 503 error, hence your visitors would see an error page instead of your website. That may trigger a Fargate ...
  • 24k
10 votes

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

The easier way is to increase number of minimum instances in Auto-Scaling Group (ASG) to double of your current count, wait when all of them are started and then change that minimum number of ...
8 votes
Accepted

Is there a way to use length of a RabbitMQ queue used by Celery to start instance in an autoscale group?

I'd suggest a cron job to publish the current queue length as a CloudWatch custom metric, which will allow you to create auto-scaling alarms based on its value.
  • 32.6k
7 votes

Static IP address for outgoing traffic from AWS autoscaling group

I don't have enough reputation to comment on the above answers, but I wanted to add some information you will need to know if using a NAT gateway to achieve this. When you create a NAT gateway, you ...
7 votes
Accepted

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 ...
  • 86
6 votes

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

the way i manage this scenario is to use the UpdatePolicy feature of the AWS::AutoScaling::AutoScalingGroup object in cloud formation. when the cloud formation stack is updated it will manage the ...
  • 660
6 votes

AWS Fargate service: scale to zero?

If re-writing your app to fit the above response it's not an option or costly, you could look into GCP CloudRun CloudRun it's serverless containers developed by GCP. You can pack your website in a ...
  • 211
5 votes
Accepted

EC2 Auto scaling to start instances, not launch them

Is this even possible in EC2? No, not using their ASG product. The whole point of using an ASG (and honestly, doing more or less anything on EC2), is that your individual compute instances should ...
  • 109k
5 votes
Accepted

AWS Autoscaling: newly created instance is not in sync with other instances

Autoscaling does one thing: Spins up/down an AMI based on defined criteria. That's it. Note the lack of a 'pull latest code' step in that list of things it does. Autoscaling assumes you're solving ...
  • 132k
4 votes

How to setup a self healing EC2 instance?

First, a disclaimer: this is not the answer you're hoping for, but it is the right answer. I have an EC2 instance running CPM/WHM There's your first problem. Your first step to reaching your goal ...
  • 109k
4 votes

AWS autoscaling and ec2 t2

T2 instances should be absolutely avoided in scenarios where your applications consistently consume their credits, precisely due to this kind of issues with the CPU credits system provided by AWS. If ...
  • 1,169
4 votes

How to get Autoscaling group Instances IP adresses

Take a look at the fine documentation for the AWS API. E.g. the aws-cli tools aws autoscaling describe-auto-scaling-instances and aws ec2 describe-instances.
  • 3,086
4 votes
Accepted

How to avoid duplicate scale-in with step scaling policy?

I had exactly the same problem. What i ended up doing was changing my scale down policy to SimpleScaling reducing by one instance at a time and setting a 10m cooldown. I've also changed my scale down ...
4 votes

AWS auto-scaling: Why do we have 'desired capacity' value at start?

Think of the min and max as global bounds. The desired capacity can change over time, as you say, in response to a load signal. This number represents the number of instances you want "now."
  • 24.9k
4 votes
Accepted

AWS auto-scaling policy - scaling-up too often

It looks like a fresh EC2 instance takes about 15 to 20 minutes to initialize and start working, but your cooldown is only 5 minutes. So 5 minutes after increasing your desired count, your new EC2 ...
  • 9,804
4 votes
Accepted

IAM user is not authorized to perform: application-autoscaling:DescribeScalableTargets

I need to add the following custom policy to one of my permission groups { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "application-...
  • 3,036
4 votes

scaling up when new object is inserted in s3

I think you'll want to setup a CodeDeploy and CodePipeline to do this. Codepipeline can monitor the source, s3, and then send the update to codedeploy to update the EC2 instances. http://docs.aws....
  • 822
4 votes
Accepted

is my understanding for aws auto-scale up and load balancer wrong?

When you are using Auto Scaling and Load Balancing, you want all your EC2 instances to be identical. So they are all (a) rooted on the same AMI image, and (b) proceed through the same initialization ...
  • 9,804
4 votes
Accepted

AWS Autoscaling Group won't honor five minute draining policy of the Target Group when scaling down

As described in the linked answer you will need an ASG Lifecycle hook to start with. Whenever the Terminating event occurs fire up a Lambda function and in that Lambda deregister your instance from ...
  • 24k
4 votes

AWS RDS: Invalid max storage size for engine name postgres and storage type gp2: 198

Your picture shows a maximum storage threshold of 198GB and usage of 197GB. According to this page the "The maximum storage threshold is the limit that you set for autoscaling the DB instance. ...
  • 30.8k
3 votes
Accepted

AWS EC2 Auto Scaling Groups, RDS, Route 53 and Constantly changing IP addresses

This means that a new inbound rule needs to be applied to the security group for RDS that allows this new EC2 instance to connect to RDS via port 5432 (postgresql). Rather than using public IPs ...
  • 1,849
3 votes

Auto-heal an EC2 instance with an Auto Scaling Group?

After a lot of research and trial/error, here's what we ended up doing: We put every server type into its own Auto Scaling Group with a user-data shell script to fully setup the servers. We utilized ...
3 votes

Using Azure Traffic Manager for an immediate increase in capacity

Steven - sounds like you need to spend a little time looking at your setup and also you need to consider cost vs. availability. Azure VMs support auto-scale via the Cloud Service into which they are ...
  • 320
3 votes

EC2 autoscalling and code deployments

I would suggest avoiding NFS shares as they create a single point of failure for your system and NFS clients may sometimes have trouble recovering from NFS server downtime. NFS is not really the "...
3 votes

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

As of 6/16/2020 EC2 AutoScaling supports Instance Refresh - a single API call to replace every instance in an ASG safely and autonomously. To use it, update your ASG, setting a Launch Configuration or ...
3 votes

AWS autoscaling and ec2 t2

My approach is to scale before you run out of CPU credits. A simple way is to define a minimum acceptable credit balance, for me this is 50. You can do this within CloudWatch. 'Create Alarm', EC2 ...

Only top scored, non community-wiki answers of a minimum length are eligible