Scaling Your Applications with AWS Elastic Beanstalk

  • AWS Elastic Beanstalk Definition: An easy-to-use service for deploying, scaling and managing web apps and services. You just provide your code and AWS manages the rest (HTTP Server, Application server, language interpreter, OS and the host). When you create an Application, first code provided will be the Application version and flows into each environment (dev, test, staging and prod)

Deployment Options

  • All in once deployment: All the instances deployed in one go
  • Rolling: Deploys each version in batches. You can define the instance batch by their size.
  • Rolling with additional batches: Deploy new instances as the same size of batches initially
  • Immutable: Even the issue of taking down the existing instances is taken care of. It gives you instances, creates a completely new AS group. When first instances pass the healthcheck, then another batch of instances created with AutoScaling. Capacity of the environment is doubled. Rolling the batches eliminates the possible issues created
  • Blue/Green: When you decide your application should not have downtime at all, you need to use Blue/Green deployment. You have an existing environment. You clone the environment you have and you give a new name to it. Then you go ahead and swap environment URLs whenever you need without any downtime.
  • You don’t get charged by using Elastic Beanstalk but only the services underlying you use bring charge
  • Elastic Beanstalk configures each AWS EC2 instance in your environment with the components necessary to run applications for the selected platform (HTTP Server, Application Server, Language Interpreter, Operating System, Libraries/Dependencies and the Host). You just control your code
  • AWS manage the auto-scaling, ELB and optional DB or even Domain Management. It will be pre-configured (Single Instance or Load Balanced & Auto-Scaling)

Building Blocks

  • Application: Straightforward, your code. Every time you give AWS something, AWS versions it for you


  • So with this, you create different environments. You can tell Elastic Beanstalk to put it whichever environment you want. Information required to deploy your APP. You basically provide the code and the region you want to run on. You have to indicate the platform type (Go, Java, Node, Python, Docker Containers, PHP, Ruby, .NET). You can pick and customize with different extensions as well.

Managed Platform Update (auto-patching)

  • Automated upgrades for bug and vulnerability fixes, latest versions of language, framework and AMIs etc. Choose your maintenance window, between minor and major updates, no downtime and impact on capacity. You can perform instance replacement


  • Helps you to modify/customize the application or configuration stacks in YAML format and should be in the root directory. For example, you want to use DynamoDB, in ebextensions, you can configure to add DynamoDB. It is recommended to use S3 Log rotations in Beanstalk to go back and debug whenever you want

  • ElasticBeanstalk is using CloudFormation underneath
  • You can also opt-in log streaming from Cloudwatch. Stream logs in real time from Elastic Beanstalk-managed Amazon EC2 instances to Cloudwatch
  • Elastic Beanstalk is fairly opinioned on web apps. Popular Use Cases for Elastic Beanstalk includes websites, API backends, mobile backends and asynchronous workers.

Elastic Beanstalk vs OpsWorks vs CloudFormation

  • Elastic Beanstalk is the highest level of offering and easiest to deploy an application on AWS
  • OpsWorks is the middle tier, operating as a full thread orchestration tool (thus the tight relationship with chef), opsworks combines straightforward deployment, configuration and management with the flexibility to handle complex implementations
  • CloudFormation is nuts and bolts, details, low level utility. When you want granular level of control about everything in your environment. CFN can handle pretty much everything, from tiny footprint, one instance web server deployments to netflix, with a templatised, code-driven approach.
  • A useful setup would be to use cfn to establish the networking topology of your aws presence and opsworks to handle specific app deployment processes within the created network space.