Search code examples
amazon-web-serviceselastic-load-balancer

Understanding elb auto instance creation


I am a begineer to aws elb. Can someone help me to understand how elb automatically creates a new instance depending on the traffic or cpu usage. Also when it creates a new instnces how does it copies code from existing instance? Any link/article will also be appreciated. Thanks in adavnce.


Solution

  • How elb automatically creates a new instance depending on the traffic or cpu usage?

    ELB does not create the new instance the new instance is created by Launch configuration and Autoscaling group rules that you have set. https://docs.aws.amazon.com/autoscaling/latest/userguide/GettingStartedTutorial.html

    Also when it creates a new instnces how does it copies code from existing instance?

    When a new instance gets created from the AMI you have to add the replication mechanism either using user data scripts (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html) or running a cron job on that instance that will copy the files to that instance from a S3 bucket.