1

I am new to AWS and learning autoscaling feature of aws. i have created one autoscaling group with min instance of 1 and max instance of 1.

For experimental purpose whenever i terminate my instance belongs to this autoscaling group that time aws automatically creates a new instance which is right as my max instance is set to 1.

But the problem is that this automatically created newly instance has no data in it and its not in sync with old instance which i have terminated for experimental purpose. so my question is if the newly created instance has no data(source code etc.) and is not in sync with the old instance then what is the use of autoscaling?

Thanks,

2 Answers 2

5

Autoscaling does one thing:

  1. 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 the code-deploy problem outside of Autoscaling. Perhaps by:

  • Creating a new AMI each time you push code, and updating the autoscaling-config to use that new AMI.
  • Use an instance's userdata script to pull new code on-boot.
  • NFS mount a code-repo, which is kept up to date through external means.

Or something else. You will have to solve that problem, autoscaling won't do it for you.

1
  • 1
    A note: AWS CodeDeploy can be configured to auto-deploy code to new auto-scaling instances.
    – ceejayoz
    Sep 16, 2015 at 19:38
1

Autoscaling requires either an AMI with your application pre-loaded into it, or a launch configuration that uses a userdata script that sets up some sort of autodeploy mechanism such as Puppet or Chef. You will also want to set up autoscaling policies that will scale your constellation up or down as load increases or decreases on your cluster.

If you are doing all of this from scratch I suggest setting up a VPC and using Amazon OpsWorks. OpsWorks is based on Chef so you'll need to use Chef for that. But Opsworks will handle injecting Chef into your instances and pointing them at the Chef server, as well as handle configuring the autoscaling groups and their launch configurations.

https://console.aws.amazon.com/opsworks/home?region=us-east-1#

I already had an existing solution based on Cloudformation and Puppet before Opsworks was introduced, so I can't help you further with that, but reading the above URL should give you a few clues.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .