AWS Elastic Beanstalk

Elastic Beanstalk (EB) is a Platform as a Service product. It allows you to deploy code and, with very little effort or modifications, the service will provision the infrastructure on your behalf.

Elastic Beanstalk handles provisioning, monitoring, Auto Scaling, load balancing, and software updating for you — you just worry about the cost.

Deploy and manage applications without worrying about the infrastructure.
Elastic Beanstalk handles capacity provisioning, health monitoring, Auto Scaling, load balancing, and updates for you automatically.
Highly available by default using two AZs and a load balancer.

Elastic Beanstalk supports a number of languages and platforms:

    • Java
    • Go
    • .NET
    • Python
    • Ruby
    • PHP
    • Node.js
    • Docker
    • IIS
    • Apache
    • Nginx
    • Tomcat

 

Patterns and Anti-Patterns for Elastic Beanstalk

  • YES: To provision an environment for an application with little admin overhead
  • YES: If you use one of the supported languages and can add EB-specific config
  • NO: If you want low-level infrastructure control
  • NO: If you need Chef support

 

Deployment Options

  • All at Once: An updated application version is deployed to all instances. Quick and simple but not recommended for production deployments. Deploy the new version to all instances simultaneously. All instances your environment are out of service for a short time while the deployment occurs.
  • Rolling: Beanstalk splits the environment’s EC2 instances into batches and deploys the new version of the application to one batch at a time.
  • Rolling with additional Batch: As above, but provisions a new batch, deploying and testing before removing the old batch (immutable).
  • Blue/Green: Maintain two environments, deploy, and swap CNAME. Deploy the new version to a separate environment, and then swap CNAMEs of the two environments to redirect traffic to the new version instantly.

When to Use Elastic Beanstalk

  • To quickly provision an AWS environment that requires little to no management
  • The application fits within the parameters of the Beanstalk service
  • Can deploy from repositories or from uploaded code files
  • Easily update applications by uploading new code files or requesting a pull from a repository