☰ See All Chapters |
AWS Elastic Beanstalk
AWS Elastic Beanstalk is used for deploying and handling applications without worrying about the infrastructure it is going to run. We simply upload the application's deployable file and Elastic Beanstalk automatically handles capacity provisioning, load balancing, auto scaling, and application health monitoring.
As an offering, Elastic Beanstalk is most directly comparable to the Platform as a Service (PaaS) development environment, like Heroku or CloudFoundry, in that it provides the ability to run code in a container that takes care of execution and resource management.
Advantages of AWS Elastic Beanstalk
Most of the PaaS providers are limited by their capabilities, applications performance drops from the limited configurations. Elastic Beanstalk, by contrast, does provide the appropriate language container and manages it on behalf of your application code.
AWS Elastic Beanstalk registers applications to load balancers automatically and directs traffic to multiple instances running your code.
AWS Elastic Beanstalk assigns routes and enables applications to access it.
It supports the use of Auto Scaling to dynamically manage the resources used by your application.
It supports versioning for each deployment, for each new deployments, it terminates the existing instances, and switches the Elastic Load Balancer or AWS routes to the new instances. You can rollback to any version of deployment easily. You can also run multiple versions of deployments parallelly and support testing.
Using Elastic Beanstalk
Below steps are the general pattern of moving code from development environment to AWS, actual steps vary from platform to platform. Steps for Java application may not be same for .NET application.
Develop the application, for Java application you can use Eclipse with AWS plugin or can use any IDE of your comfort.
environment.
Create the Elastic Beanstalk environment via the Management Console, AWS API, or AWS SDK.
Upload the application code to the Elastic Beanstalk environment. For .NET and Java, you can do it via the IDE. For the other languages, it’s done via Git version control system. AWS provides instructions to configure Git to work with Elastic Beanstalk.
Manage your application, if you can’t use the default Elastic Beanstalk configuration. For example, you may change the application’s instance size or the Auto Scaling rules. Elastic Beanstalk is integrated with CloudWatch, so you can view important metrics or even set CloudWatch to alert you when those metrics trigger a specified condition.
Components of AWS Elastic Beanstalk
An application is a logical container. It contains versions, environments, and configurations. If you start to use AWS Elastic Beanstalk in a region, you have to create an application first.
A version contains a specific release of your application executables. To create a new version, you have to upload your executables (packed into an archive) to Amazon S3, which stores static files. A version is basically a pointer to this archive of executables. If you consider Java application, it may be a JAR and WAR file.
A configuration template contains your default configuration. You can manage your application’s configuration (such as the port your application listens on) as well as the environment’s configuration (such as the size of the virtual machine) with your custom configuration template.
An environment is where AWS Elastic Beanstalk executes your application. It is actually a deployment and where application is running. It consists of a version and the configuration. You can run multiple environments for one application by using different combinations of versions and configurations.
All Chapters