One of the first questions that new users ask when researching Elastic Beanstalk, is how it is different from Amazon EC2. And this understandable, as both services can be used similarly for certain workloads.
Yet, there are profound difference between them, too.
As we learned in the introduction to Elastic Beanstalk, it is basically one layer of abstraction away from the EC2 layer. When you create a Beanstalk application, the servers are EC2 instances, and are configured behind a load balancer to expose them to the outside world.
Yes, a Beanstalk orchestrated infrastructure hides away a couple of things, as it sets up an environment for you that contains EC2 instances, databases, security and scaling groups, and what not. Time to dive into the details on how and where two services differ.
EC2 is the Amazon service that lets you create and launch servers in the AWS cloud. These instances, as they are called, provide a complete web services API to access the various services available on the Amazon Web Services platform.
To understand Elastic Beanstalk, you need to know how it works.
This service, that Amazon launched on January 19, 2011, provided developers with a platform to deploy their applications on the cloud, and then connect them with a number of Amazon AWS services. Which is to say that you can’t treat Elastic Beanstalk as a black box — you have to have a good enough idea of the underlying AWS services, and how Elastic Beanstalk makes them work in concert.
In other words, Elastic Beanstalk brings together AWS services like EC2, Auto Scaling, and S3 for the purpose of deploying elastic cloud applications.
When you launch an environment, Elastic Beanstalk simply takes a predefined AIM that comes with a n installed operating system, and launches a new instance of the type that you specify. Beanstalk also sets up an elastic load balancer, and makes it respond to a distinct URL.
And because Elastic Beanstalk orchestrates different AWS services, it provides additional ways to interact with them. Although things are set well enough by default, you can directly manipulate the assets that EB manages. Basically, you have the option to bypass, overwrite, and adjust anything and everything that Elastic Beanstalk does, and customize things according to your needs and requirements.