Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

AWS Elastic Beanstalk provisions and coordinates familiar AWS resources rather than running applications on a separate, proprietary compute layer. A typical production web environment uses a load balancer to route requests to EC2 instances in an Auto Scaling group; a worker environment instead consumes jobs from Amazon SQS. The right design depends on the environment tier, availability needs, network layout, and how the application handles state.

What Elastic Beanstalk creates and manages

Elastic Beanstalk is an application-management service: you provide application code and configuration, and it provisions and coordinates resources such as EC2, Auto Scaling, Elastic Load Balancing, Amazon S3, IAM, and CloudWatch. It can also work with services such as SQS, RDS, and VPC components. It reduces the work of assembling a deployment, but the application owner still designs the network and data architecture, secures permissions, manages application behavior, and pays for the underlying resources. AWS’s overview and web-server architecture guide describe the underlying model.

Concept or resource Role in the architecture Operational responsibility
Application Logical container for application versions, environments, and saved configurations; it is not the running infrastructure. Organize environments and releases.
Application version Deployable source bundle, such as a ZIP or WAR, stored in S3 and deployed to an environment. Manage artifacts and choose which version runs.
Environment Running AWS resource collection for one application version at a time. Choose capacity, networking, deployment, and operational settings.
Platform Operating system, language runtime, server, and Elastic Beanstalk components used to run the application. Select a supported platform branch and plan updates.
EC2 and Auto Scaling Run the application and adjust fleet capacity according to configured settings. Set instance type, capacity bounds, scaling behavior, and application readiness.
Load balancer Receives web traffic and forwards it to healthy instances in a load-balanced environment. Configure listeners, TLS, health checks, and public or internal access.
Application bundle storage Amazon S3 stores application versions. Manage artifact retention and access.
IAM and CloudWatch IAM enables service and instance permissions; CloudWatch supports monitoring and alarms. Set least-privilege access, logs, metrics, alarms, and retention.
Database or queue RDS or another database can serve application data; SQS can provide worker jobs. Own data lifecycle, backups, retries, and recovery. Keep production data independent of an environment’s lifecycle.

These distinctions matter during deployment: an application can have several environments, while each environment runs one application version at a time. A version can be deployed to development, staging, and production environments. The environment tier determines whether the environment is designed for web requests or background work. See Elastic Beanstalk core concepts and supported platforms.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How a web-server environment handles a request

In a load-balanced web environment, a client reaches the environment hostname, the load balancer receives the request, and the balancer forwards it to an EC2 instance that passes health checks. The instance runs the chosen platform and application version. Auto Scaling can add or remove instances within the configured capacity and scaling rules. Elastic Beanstalk typically coordinates the load balancer, Auto Scaling group, and instances for this environment type. AWS’s web-server environment guide explains this flow.

Users
  │
  ▼
DNS / Elastic Beanstalk environment URL
  │
  ▼
Load balancer
  │
  ├── EC2 instance in Availability Zone A
  └── EC2 instance in Availability Zone B
       │
       ├── Application and runtime
       └── Health reporting and logs
  │
  ▼
Independent data services, such as RDS, S3, or DynamoDB

For an internet-facing production service, a common baseline is a public load balancer in public subnets and application instances in private subnets in at least two Availability Zones. The instances generally need a planned route to required AWS services and other outbound destinations. That may mean NAT gateways, suitable VPC endpoints, or both, depending on the platform and application. This design improves isolation, but it adds network components that must be configured and budgeted. AWS describes subnet layouts and connectivity requirements in its VPC configuration guide.

Choose single-instance, load-balanced, or worker architecture

Environment type Core resources Best suited to Main limitation
Single instance One EC2 instance with an Elastic IP; no load balancer. Auto Scaling capacity is fixed at one. Development, demos, temporary environments, or low-traffic internal tools. One instance is a single point of failure and offers no horizontal fleet scaling.
Load-balanced web server Load balancer, Auto Scaling group, and one or more EC2 instances. Most production web applications that need traffic distribution and the option to scale horizontally. More resources, configuration, and cost; scaling does not fix bottlenecks in dependencies.
Worker SQS queue, worker daemon, and EC2 worker instances; no web load balancer in the request path. Asynchronous jobs or long-running background processing. Requires robust retry, duplicate-message, timeout, and failure handling in the application.

A load-balanced environment can be configured for multiple Availability Zones, but that alone does not make the whole application highly available. Health checks, capacity, database resilience, and other dependencies must also support the required availability. A single-instance environment is cheaper in infrastructure terms because it omits the load balancer, but it should not be treated as a highly available production design. See environment types.

Worker environments: design the queue contract

A worker environment uses Amazon SQS to decouple job creation from processing. A producer places a message on a queue; a daemon on each worker instance reads messages and passes them to the application. Elastic Beanstalk can create and configure a queue if one is not supplied. Adding instances can increase consumers, but it does not guarantee that every job runs once or finishes successfully. See worker environment architecture.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Make handlers idempotent so a repeated message does not duplicate an irreversible operation.
  • Set the visibility timeout to accommodate normal processing time, and extend it where longer jobs require it.
  • Use a dead-letter queue and a deliberate retry policy for poison messages or repeated failures.
  • Handle graceful shutdown so an instance being replaced does not abandon work in progress.
  • Scale against queue depth and processing capacity, not just web request metrics.
  • Where a job updates a database, design the write and message-acknowledgment sequence to tolerate retries and partial failure.

Place the environment in a VPC deliberately

Public-only layout

In a public-only layout, the load balancer and instances use public subnets. This avoids NAT gateway requirements and is the least expensive of the VPC layouts AWS documents, but public-facing instances increase the security burden. Restrict instance ingress to the load balancer where possible and apply narrow security-group rules.

Public load balancer, private instances

For a common public production design, put an internet-facing load balancer in public subnets and application instances in private subnets across the intended Availability Zones. Instances have no public IP addresses; their security groups allow application traffic from the load balancer rather than from the whole internet. NAT gateways can provide general outbound access. VPC endpoints may provide private access to specific AWS services, but they are not a blanket substitute for all internet egress needs.

Private or internal service

An internal load balancer and private instances fit services reached from the VPC or connected networks, such as through peering, Transit Gateway, VPN, or Direct Connect. This is not a public website design unless a separate public ingress layer is provided.

Subnet selection, route tables, security groups, and network ACLs must match the chosen topology. Private instances need working routes or endpoints for the AWS services they must reach. AWS also notes that NTP traffic on UDP port 123 is required for time synchronization and reliable health reporting; network rules that block it can cause problems. Elastic Beanstalk does not support proxy settings such as HTTPS_PROXY to configure a web proxy. Check the VPC guide for the documented requirements.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Keep application data independent from replaceable instances

Application instances can be added, replaced, or terminated during scaling and deployments. Their local filesystems are neither shared across the fleet nor durable storage for application data. A file uploaded to one instance may be unavailable to another instance or disappear when the instance is replaced. Choose storage by access pattern: for example, S3 for object storage, a database for structured records, or EFS when shared file access is genuinely required.

For production, manage the database lifecycle independently from the application environment. A separately managed RDS or Aurora database, for example, can outlive an environment replacement and be shared deliberately by blue and green environments. AWS warns that a database created with an Elastic Beanstalk environment requires care during environment swaps or termination; do not assume production data will be preserved as desired. See the blue/green deployment guidance.

Scaling web instances also requires an application that does not depend on instance-local sessions, caches, or uploads. Externalize or deliberately manage those forms of state; otherwise, requests routed to different instances can see inconsistent data.

Pick a deployment strategy that matches risk and capacity

Strategy How it works Trade-off
All at once Updates existing instances together. Fast, but can interrupt service or reduce availability while deployment runs.
Rolling Updates instances in batches while other instances remain on the old version. Can preserve service capacity, but old and new versions coexist temporarily and must be compatible.
Rolling with additional batch Adds capacity before updating batches of existing instances. Maintains capacity more fully during rollout at the cost of temporary extra instances and more time.
Immutable Launches a separate temporary Auto Scaling group for the new version; replaces the old fleet only after the new instances pass health checks. Safer isolation for rollback, but temporarily needs extra capacity and can fail if the new fleet never becomes healthy.
Traffic splitting Uses an Application Load Balancer to send a configured share of traffic to the new fleet during a test period. Enables a canary-style rollout, but runs two fleets and requires the new version to work alongside the old one.
Blue/green Runs two separate environments; test the green environment, then swap the environment URLs. Provides a distinct environment for validation, but requires attention to DNS caching, database compatibility, and the cost of retaining both environments.

Deployment settings and availability depend on environment type and configuration. Consult AWS’s deployment policy documentation, rolling and traffic-splitting settings, and immutable update guidance before choosing a policy.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Blue/green release sequence

  1. Create or clone a second environment and deploy the candidate version there.
  2. Test the new environment independently, including its health checks and dependencies.
  3. Swap environment URLs when ready, then verify application behavior on the new environment.
  4. Keep the old environment until verification, rollback needs, and DNS caching considerations have been addressed; terminate it when it is no longer needed.

A URL swap does not make a database migration reversible. Use an expand-and-contract approach: add backward-compatible schema first, deploy code that can operate with both schemas, migrate or backfill data, switch behavior, and remove old schema only after rollback is no longer needed.

Use health monitoring to diagnose readiness, not just process status

Basic health reports an environment’s general state. Enhanced health combines signals from the operating system, web-server logs, HTTP responses, latency, load-balancer and Auto Scaling data, and deployment state. On supported platform versions, an agent on instances reports health; the information appears in the environment overview and can be inspected with eb health. Enhanced-health metrics can also be published to CloudWatch, where custom-metric charges may apply. AWS documents agent reporting at approximately 10-second intervals and environment-level CloudWatch publication every 60 seconds when configured; treat these as documented behavior, not a guarantee of instantaneous alerting. See enhanced health reporting.

Choose a health-check URL that is fast and deterministic. It should return success only when an instance is ready to serve traffic, without making every check depend on a slow query or third-party service. AWS notes that a load balancer may send traffic soon after a TCP connection is considered healthy; an application health-check URL can help keep traffic away until startup is complete.

  • AWS documents web-server environments passing 12 consecutive health checks over two minutes and worker environments passing 18 over three minutes as deployment health conditions.
  • The documented default command timeout is 10 minutes.
  • These are AWS documentation defaults, not universal startup limits; platform behavior, configuration, health settings, and deployment policy affect outcomes.

Use environment events, application and web-server logs, load-balancer health, and CloudWatch alarms together. Enhanced-health data can be inspected from the Elastic Beanstalk environment overview or with the EB CLI. CloudWatch integration details are in AWS’s CloudWatch guide.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Protect the control plane and application instances with IAM

Elastic Beanstalk commonly uses a service role to let the service interact with AWS and an EC2 instance profile to grant permissions to the application instances. These are distinct identities: an application’s AWS API access should not be granted by giving its instances broad administrator permissions. Add only the permissions the application and platform need, and review the managed web-tier or worker-tier policies for the intended role.

A custom instance profile missing required health-reporting permissions, including elasticbeanstalk:PutInstanceStatistics where enhanced-health authorization is enabled, can leave enhanced health showing No Data. Check instance-profile permissions along with network connectivity when health reporting is absent. AWS documents the role and permission considerations in its enhanced health guide.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Deploy and operate an environment

Console workflow

  1. Open the Elastic Beanstalk console, select the AWS Region, and create or select an application.
  2. Create an environment and choose the web-server or worker tier.
  3. Select a currently supported platform branch; platform versions and availability change, so do not copy a stale platform version from an old tutorial.
  4. Choose single-instance or load-balanced capacity, then configure VPC, subnets, security groups, and load-balancer settings as applicable.
  5. Upload the source bundle and deploy. For a later release, open Environments, select the environment, choose Upload and deploy, upload the bundle, then choose Deploy.
  6. Configure health checks, scaling, deployment policy, logs, and alarms; verify the environment before directing production traffic to it.

EB CLI workflow

A representative workflow is:

eb init
eb create myapp-prod
eb deploy
eb health
eb logs
eb status

The exact platform choices and options depend on runtime and Region. Install the current EB CLI release and verify it locally with eb --version; AWS’s EB CLI guide covers installation and use. The AWS CLI can call lower-level Elastic Beanstalk APIs, while EB CLI is organized around common application workflows.

Understand the cost drivers

Elastic Beanstalk has no additional service charge, but the AWS resources it provisions or uses are billed. The total depends on Region, instance types and hours, traffic, storage, and the chosen architecture; there is no useful universal monthly figure without those assumptions. Single-instance environments omit a load balancer, while load-balanced production designs add one. NAT gateways, RDS, CloudWatch metrics and logs, data transfer, and temporary duplicate fleets during immutable, traffic-splitting, or blue/green releases can all add cost. See Elastic Beanstalk pricing and estimate the selected resources for a specific Region and workload with the AWS Pricing Calculator.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When Elastic Beanstalk fits—and when to choose another service

Elastic Beanstalk is a practical fit for conventional web applications and worker services on supported platforms when a team wants managed deployment, health reporting, and Auto Scaling while retaining access to the underlying AWS resources. It is less compelling when the design depends on Kubernetes primitives, extensive host customization, service-mesh or sidecar behavior, or an event-driven execution model. AWS’s Lightsail, Elastic Beanstalk, and EC2 decision guide frames some of these control-versus-management trade-offs.

Alternative Consider it when Trade-off from Elastic Beanstalk
Amazon EC2 You need maximum host, operating-system, networking, and deployment control. You take on substantially more infrastructure and deployment management. EC2
Amazon Lightsail The application is small, simple, and has predictable requirements. Less granular scaling and customization. Lightsail
ECS with Fargate The application is containerized and you want service-level scheduling without managing EC2 hosts. Requires container, task-definition, networking, IAM, and observability concepts. ECS and Fargate
App Runner You want a more opinionated managed path from source or containers to a web service. Offers less detailed infrastructure control. App Runner
Lambda The workload is event-driven and fits function execution constraints. Execution, runtime, concurrency, and state constraints make it unlike a general-purpose long-running server. Lambda
EKS You specifically need Kubernetes compatibility or its ecosystem. Introduces substantially more platform complexity. EKS

Troubleshoot common architecture failures

Environment becomes unhealthy after a deployment

  • Review environment events and run eb health; retrieve logs with eb logs.
  • Check that the application binds to the expected port, the configured health-check URL returns the expected response, and startup finishes within the configured timing.
  • Verify required environment variables, database connectivity, security-group rules, and instance-profile permissions.
  • Compare which application version is running on each instance and whether a deployment remains in progress.
  • Where appropriate, redeploy the prior known-good version; use immutable or blue/green releases when you need stronger separation for future changes.

Instances cannot reach AWS services

Check private-subnet routes, NAT or required VPC endpoints, DNS resolution, security groups, network ACLs, and NTP access. An endpoint only provides access to its corresponding service; it does not supply general internet connectivity.

Deployment appears stuck

Look for health checks that never pass, a startup migration that takes too long, an application that has not bound to its port, insufficient batch capacity, a hanging lifecycle command, missing outbound connectivity, or a policy unsuitable for the environment type. The documented 10-minute default command timeout is not a substitute for fixing an unhealthy startup path.

Rollback restores code but not the whole system

Application-version rollback does not necessarily undo database schema changes, data transformations, queue messages, external API side effects, S3 changes, infrastructure settings, or secrets and environment-variable changes. Make those changes independently reversible or backward-compatible where the release requires rollback.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A practical production baseline

  • Use a load-balanced web-server environment across at least two Availability Zones when availability matters.
  • Put the public load balancer in public subnets and application instances in private subnets, with deliberate egress through NAT, VPC endpoints, or both.
  • Keep databases and durable files outside replaceable instances and manage their lifecycle separately.
  • Design the application to tolerate multiple instances, including externalized sessions and idempotent background work.
  • Choose a health-check path that proves readiness without depending on slow or fragile downstream systems.
  • Use least-privilege service roles and instance profiles, enhanced health, logs, and actionable CloudWatch alarms.
  • Select a deployment policy based on acceptable temporary capacity, version compatibility, rollback needs, and database migration strategy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.