AWS Elastic Beanstalk

A PaaS deployment service that automates everything from infrastructure provisioning to scaling simply by uploading application code

Overview

AWS Elastic Beanstalk is a PaaS (Platform as a Service) that simplifies the deployment and management of web applications and services. When a developer uploads application code, Elastic Beanstalk automatically provisions the infrastructure - EC2 instances, load balancers, Auto Scaling groups, security groups, and more - and runs the application. It supports Java, .NET, PHP, Node.js, Python, Ruby, Go, and Docker, with automatic configuration of web servers such as Apache, Nginx, and IIS. There is no charge for Elastic Beanstalk itself; you only pay for the underlying AWS resources (EC2, ELB, RDS, etc.). When detailed infrastructure configuration is needed, customization is available through configuration files (.ebextensions) or the management console.

CloudFormation-Based Environment Provisioning and Web/Worker Tiers

Elastic Beanstalk internally uses CloudFormation stacks to manage infrastructure. Creating an environment automatically provisions EC2 instances, security groups, Auto Scaling groups, an Elastic Load Balancer, CloudWatch alarms, and more. Two environment types are available: Web Server environments for applications that handle HTTP requests, and Worker environments for applications that pull messages from SQS queues for background processing. Combining both tiers lets you offload long-running tasks from the web tier to the worker tier, keeping response times low. Unlike Azure App Service, which runs in a fully managed environment with restricted direct OS access, Elastic Beanstalk deploys on top of EC2 instances, allowing SSH access for OS-level customization and debugging. Configuration files (.ebextensions) and platform hooks provide fine-grained control over packages, services, and environment variables without leaving the Beanstalk workflow.

Five Deployment Strategies and Risk Design

Elastic Beanstalk supports five deployment strategies, each with different trade-offs between speed, downtime, and risk. All at once deploys to all instances simultaneously - fastest but causes brief downtime. Rolling updates a batch of instances at a time, maintaining partial capacity throughout. Rolling with additional batch launches new instances before taking old ones out of service, preserving full capacity during deployment. Immutable creates an entirely new Auto Scaling group with the new version, then swaps it in, providing safe rollback by simply terminating the new group. Blue/Green uses two separate environments with DNS switching via Route 53, offering the safest rollback path at the cost of running duplicate infrastructure temporarily. For a deeper look at AWS Elastic Beanstalk, specialized books (Amazon) are a great resource.

Migration Paths to ECS and Lambda, and Selection Criteria

Elastic Beanstalk is well suited for teams that want to minimize time spent on infrastructure management while retaining a degree of customizability. Typical use cases include MVP development for startups, rapid deployment of internal tools, and cloud migration of existing monolithic applications. However, as applications grow, a migration path to more specialized services often becomes necessary. For microservices architectures, ECS provides finer control over container orchestration, task placement, and service mesh integration. For event-driven or short-lived workloads, Lambda eliminates server management entirely and scales to zero when idle. In practice, a phased approach is effective: start with Elastic Beanstalk for rapid deployment in the early stages, then gradually extract services into ECS tasks or Lambda functions as the architecture evolves. The Docker platform on Beanstalk can serve as a stepping stone, since containerized applications are straightforward to migrate to ECS.

共有するXB!