Elastic Beanstalk — DVA-C02 Mastery Guide
- Sources: course chapter 10 (Elastic Beanstalk,
notes/source/10.Beanstalk.pdf). The course serves as the syllabus only; all wording here is original. Written 2026-10-12.- Values checked against AWS docs on 2026-10-12. The marker
⚠️ Changed: <current>. Older material may say <old>.flags a value or behaviour that differs from the course or older practice tests: learn the current value.⚠️ unverifiedmarks a value the docs did not confirm;⚠️ volatilemarks lists AWS changes often (platform branches, new modes). Every change is listed in Changed vs older material.- Tier 2 (deployment and messaging), bank target 30 questions. Domain: Deployment.
- How to use it:
/explain <topic>teaches from these sections (concept → exam facts → developer angle → traps → 3 check questions);/quiz beanstalkasks bank questions whosesource_notelinks point at the## N.headings below;/drill beanstalkfires short recall prompts fromnotes/beanstalk-cheat-sheet.md. Suggested loop: read a section and answer its practice questions before opening the answers →/explainwhat is still unclear →/quiz beanstalk→/drill beanstalk.
How Elastic Beanstalk appears on DVA-C02
Beanstalk questions are deployment questions. The exam treats it as the managed way to run a web app or a queue worker without assembling EC2, Auto Scaling, load balancing and monitoring yourself, and it asks what a developer must choose or configure:
- Deployment policy under a constraint: zero downtime, full capacity during the rollout, lowest extra cost, fastest and safest rollback, or a canary share of traffic. Most Beanstalk items are this shape.
- Blue/green: a second environment plus Swap environment URLs, or Route 53 weighted records; when it is required (platform branch change, load balancer type change, coupled database).
- Configuration in code: where
.ebextensionsfiles live, whatoption_settings,Resources,commandsandcontainer_commandsdo, and which setting wins when the same option is set twice. - Worker tier: SQS daemon,
cron.yamlperiodic tasks, dead-letter queue and timeouts. - Operations: the application-version quota and the lifecycle policy, decoupling a database, Docker variants, cloning, environment variables and secrets, health and logs after a failed deployment.
Typical question shapes: a scenario with one deciding constraint; "Which TWO…" with five options; the exact namespace, option, file name or CLI command that does the job.
Domain map: Deployment → every topic. Security angles appear inside deployment scenarios (§1 roles and policies, §10 secrets); troubleshooting angles in §6, §7 and §14.
Out of scope: OS administration (packages, proxy tuning, file systems) and network design (subnets, routing, NAT). Neighbouring modules own: CloudFormation syntax and stack behaviour (notes/cloudformation-guide.md), CodePipeline/CodeBuild/CodeDeploy (notes/cicd-guide.md), SQS semantics (notes/sqs-sns-kinesis-guide.md), Secrets Manager vs Parameter Store (notes/security-encryption-guide.md), RDS features (notes/rds-guide.md), ECS/ECR/EKS (notes/containers-guide.md), CloudWatch and X-Ray (notes/monitoring-guide.md), Route 53 routing (notes/route53-guide.md), and IMDS, load balancers, Auto Scaling and Spot (notes/ec2-mastery-guide.md §2, §8, §10, §5).
| # | Topic | Why it is on the exam |
|---|---|---|
| 1 | Core concepts and Elastic Beanstalk modes | Application, version, environment and configuration vocabulary; roles, policies and quotas behind every scenario |
| 2 | Environment types and load balancers | Single instance vs load balanced, which load balancer, what can't change after creation |
| 3 | Worker environments and periodic tasks | Offloading long jobs to SQS, cron.yaml, timeouts and the dead-letter queue |
| 4 | Platforms and platform updates | What runs today, in-place updates vs blue/green, managed updates, custom AMIs |
| 5 | Deployment policies compared | The most tested Beanstalk decision: the policy that fits the constraint |
| 6 | Rolling deployments and configuration updates | Batches, health checks, timeouts, and the separate rolling-update settings for instance replacement |
| 7 | Immutable and traffic splitting deployments | New instances, quick rollback, canary percentages and their limits |
| 8 | Blue green deployments and cloning | URL swap, DNS caching, when a second environment is mandatory, what a clone copies |
| 9 | ebextensions and configuration precedence | Configuration as code, CloudFormation resources, run-once commands, which value wins |
| 10 | Environment properties and secrets | Passing settings and secrets to code, size limits, refresh after rotation |
| 11 | RDS databases and decoupling | Coupled vs external databases and the deletion policy |
| 12 | Docker and container environments | Docker, ECS-based and Cluster options; Dockerrun.aws.json versions; ECR access |
| 13 | Source bundles and the lifecycle policy | Bundle rules, the version quota and automatic cleanup |
| 14 | Health logs and troubleshooting | Enhanced health, tail vs bundle logs, CloudWatch Logs, X-Ray, reading failures |
1. Core concepts and Elastic Beanstalk modes
Concept
- Beanstalk takes a deployable artifact and stands up the infrastructure around it in your account (EC2 instances in an Auto Scaling group, an optional load balancer and database, health reporting and logs), then keeps it running. Nothing is hidden: you can inspect and tune every resource it creates. There is no separate Beanstalk fee: the bill comes from the EC2, load balancer, storage and database resources.
- The objects nest: an application groups application versions (labeled pointers to a source bundle in S3), environments (the running resources) and saved configurations (named option sets, called configuration templates in the API).
- An environment runs one version at a time; the same version can run in several environments (for example staging and production) at once.
- Every setting is a configuration option inside a namespace (
aws:autoscaling:asg,aws:elasticbeanstalk:command, …). You set options from the console, EB CLI, AWS CLI/SDK, a saved configuration or.ebextensionsfiles (§9). - A Standard environment is a CloudFormation stack that Beanstalk owns. Its resources have fixed logical names (
AWSEBAutoScalingGroup,AWSEBV2LoadBalancer,AWSEBSecurityGroup,AWSEBRDSDatabase, …) that configuration files can reference or extend (§9). Template syntax: see notes/cloudformation-guide.md. - ⚠️ Changed: since 2026-09-17 Beanstalk has two modes — Beanstalk Standard (EC2 instances in an Auto Scaling group dedicated to the environment; the subject of this guide unless noted) and Beanstalk Cluster (your container image runs as replicas on a service-operated Amazon EKS cluster with EKS Auto Mode, shared by your environments that use the same subnet set). Older material may say Beanstalk always runs your code on EC2 instances in its own Auto Scaling group. ⚠️ volatile: Cluster mode postdates most exam items.
Exam facts
- Tiers: web server (serves HTTP, gets a URL), worker (reads an SQS queue, §3) and, in Cluster mode, the cluster tier.
- Quotas per account and Region, all adjustable in Service Quotas: applications 75 · application versions 1,000 (shared by all applications in the Region) · configuration templates 2,000 · environments 200 · custom platform versions 50.
- Beanstalk keeps versions, logs and saved configurations in a per-Region bucket named
elasticbeanstalk-<region>-<account-id>.
| Role | Default name | Trusted principal | Managed policies |
|---|---|---|---|
| Service role (Beanstalk manages resources, health, managed updates) | aws-elasticbeanstalk-service-role |
elasticbeanstalk.amazonaws.com, condition sts:ExternalId = elasticbeanstalk |
AWSElasticBeanstalkEnhancedHealth, AWSElasticBeanstalkManagedUpdatesCustomerRolePolicy |
| EC2 instance profile (credentials for your code and the on-instance agents) | aws-elasticbeanstalk-ec2-role |
ec2.amazonaws.com |
AWSElasticBeanstalkWebTier (log upload to S3, X-Ray), AWSElasticBeanstalkWorkerTier (queue, leader election, periodic tasks, metrics), AWSElasticBeanstalkMulticontainerDocker (ECS) |
- ⚠️ Changed: Beanstalk no longer creates the default
aws-elasticbeanstalk-ec2-roleinstance profile; create it in IAM (trusted service Elastic Beanstalk, use case Elastic Beanstalk – Compute) or pick your own profile. Older material may say the console creates it automatically for your first environment. An existing default profile keeps working. - Your application's own AWS calls (S3, DynamoDB, …) need permissions added to the instance profile role, never access keys in code or environment properties. Credential chain and IMDS: see notes/ec2-mastery-guide.md §1–§2.
- The console and EB CLI create
aws-elasticbeanstalk-service-rolewhen it is missing. Through the API without a service role, Beanstalk creates its monitoring service-linked role instead (the caller needsiam:CreateServiceLinkedRole). Handing either role to Beanstalk needsiam:PassRole(see notes/advanced-identity-guide.md). - ⚠️ Changed: user policies are
AdministratorAccess-AWSElasticBeanstalk(full) andAWSElasticBeanstalkReadOnly. Older material may sayAWSElasticBeanstalkFullAccess/AWSElasticBeanstalkReadOnlyAccess, which are being retired; the old service policyAWSElasticBeanstalkServiceis replaced byAWSElasticBeanstalkManagedUpdatesCustomerRolePolicy. - ARNs carry the application name in the path:
arn:aws:elasticbeanstalk:<region>:<account>:environment/<app>/<env>,…:applicationversion/<app>/<label>,…:configurationtemplate/<app>/<name>; a solution stack has no account:arn:aws:elasticbeanstalk:<region>::solutionstack/<name>. - Beanstalk condition keys:
elasticbeanstalk:InApplication,FromApplicationVersion,FromConfigurationTemplate,FromSolutionStack,FromEnvironment,FromApplication. - Beanstalk permissions divide duties; they don't fence the underlying resources. A user who may create the EC2, Auto Scaling and load balancer resources can create them directly as well.
Developer angle
Register a version and create or update an environment with the AWS CLI:
# 1. Upload the bundle and register it as a version (--process validates .ebextensions first)
aws s3 cp orders-v42.zip s3://elasticbeanstalk-eu-west-1-111122223333/orders/orders-v42.zip
aws elasticbeanstalk create-application-version \
--application-name orders --version-label v42 \
--source-bundle S3Bucket=elasticbeanstalk-eu-west-1-111122223333,S3Key=orders/orders-v42.zip \
--auto-create-application --process
# 2. Create a load-balanced web environment with an ALB: the API default of LoadBalancerType
# is classic, so set it explicitly (solution stack names change with every platform
# release; list them with: aws elasticbeanstalk list-available-solution-stacks)
aws elasticbeanstalk create-environment \
--application-name orders --environment-name orders-prod --version-label v42 \
--solution-stack-name "64bit Amazon Linux 2023 v6.11.10 running Node.js 24" \
--option-settings \
Namespace=aws:elasticbeanstalk:environment,OptionName=LoadBalancerType,Value=application \
Namespace=aws:autoscaling:launchconfiguration,OptionName=IamInstanceProfile,Value=orders-ec2-profile \
Namespace=aws:elasticbeanstalk:environment,OptionName=ServiceRole,Value=aws-elasticbeanstalk-service-role
# 3. A later deployment only points the environment at another version
aws elasticbeanstalk update-environment --environment-name orders-prod --version-label v43
aws elasticbeanstalk describe-events --environment-name orders-prod --max-records 20
Least-privilege deployer limited to one application (it still needs permissions on the underlying S3, CloudFormation and EC2 resources):
{
"Version": "2012-10-17",
"Statement": [{
"Sid": "DeployOrdersOnly",
"Effect": "Allow",
"Action": ["elasticbeanstalk:CreateApplicationVersion", "elasticbeanstalk:UpdateEnvironment"],
"Resource": [
"arn:aws:elasticbeanstalk:eu-west-1:111122223333:applicationversion/orders/*",
"arn:aws:elasticbeanstalk:eu-west-1:111122223333:environment/orders/*"
],
"Condition": {"StringEquals": {
"elasticbeanstalk:InApplication": "arn:aws:elasticbeanstalk:eu-west-1:111122223333:application/orders"}}
}]
}
- EB CLI equivalents:
eb init(binds the project folder to an application, platform and Region, creating the application in your account if needed; settings in.elasticbeanstalk/),eb create,eb deploy,eb status,eb open,eb terminate;eb health,eb eventsandeb logsfor troubleshooting (§14),eb configfor settings (§9). The EB CLI is a separate tool from the AWS CLI (aws elasticbeanstalk …). - Change settings through Beanstalk (console,
eb config,update-environment --option-settings,.ebextensions). Edits made directly in the EC2, Auto Scaling or RDS consoles are unmanaged: they drift from the environment definition, can be overwritten on the next update and are not cloned.
Traps
- Trap: "Beanstalk runs on AWS-owned servers outside my account." → Reality: it provisions ordinary resources in your account, and you pay for them.
- Trap: "One environment can serve two versions permanently for A/B tests." → Reality: one version per environment; traffic splitting mixes versions only during a deployment, and blue/green uses two environments.
- Trap: "Each application has its own 1,000-version quota." → Reality: 1,000 is per account per Region, shared by all applications (and adjustable).
- Trap: "The console creates the EC2 instance profile for me." → Reality: not anymore; create a role trusted by
ec2.amazonaws.comwith the Beanstalk managed policies you need. - Trap: "Give the instances the service role." → Reality: the service role is assumed by Beanstalk itself; instances get the EC2 instance profile.
- Trap: "Store an IAM user's keys as environment properties so the SDK works." → Reality: add permissions to the instance profile role; the SDK finds its credentials automatically.
Practice questions
-
A developer in a newly created AWS account launches the first Elastic Beanstalk environment from the console. The wizard asks for an EC2 instance profile, but the account has none. The application only needs to upload its logs to Amazon S3 and send traces to AWS X-Ray, with the least privilege that Elastic Beanstalk documents. What should the developer do?
- A. Select the existing
aws-elasticbeanstalk-service-rolerole as the environment's EC2 instance profile. - B. Attach
AdministratorAccess-AWSElasticBeanstalkto the developer's IAM user and run the create wizard again. - C. Save an IAM user's access key ID and secret access key as environment properties for the SDK to use.
- D. Create a role trusted by
ec2.amazonaws.comwithAWSElasticBeanstalkWebTierand choose its profile.
- A. Select the existing
-
A platform team must let a contractor deploy new versions of the
ordersapplication to its existing environments, without being able to create or delete applications or to change any other application. Which TWO policy elements implement this least-privilege requirement? (Select TWO.)- A. Attach
AdministratorAccess-AWSElasticBeanstalkand add an explicit deny forelasticbeanstalk:DeleteApplication. - B. Allow
elasticbeanstalk:CreateApplicationVersionandelasticbeanstalk:UpdateEnvironmenton version and environment ARNs whose path starts withorders/. - C. Allow
elasticbeanstalk:*on the resourcearn:aws:elasticbeanstalk:*:*:application/ordersonly. - D. Add a condition that
elasticbeanstalk:InApplicationequals the ARN of theordersapplication. - E. Attach the
AWSElasticBeanstalkReadOnlymanaged policy to the contractor's IAM user.
- A. Attach
Answers
- D. Beanstalk no longer creates the default instance profile, and
AWSElasticBeanstalkWebTiercovers S3 log upload and X-Ray. A uses the role that Beanstalk itself assumes, which EC2 can't assume; B doesn't bring back automatic creation and grants far more than needed; C puts long-term keys on the instances. - B, D. Actions on versions and environments are authorized against their own ARNs, and
InApplicationpins them toorders. A starts from full access; C names the application ARN, which doesn't cover version or environment resources; E is read-only and can't deploy.
2. Environment types and load balancers
Concept
- Single-instance environment: one EC2 instance with an Elastic IP, still in an Auto Scaling group whose minimum, maximum and desired capacity are all 1, and no load balancer. Cheapest; for development, testing or very low traffic.
- Load-balanced, scalable environment: an Elastic Load Balancing load balancer in front of an Auto Scaling group that can span Availability Zones. The production shape.
- You can switch an environment between the two types later (configuration → Capacity → Environment type, option
EnvironmentType=SingleInstance|LoadBalanced). The load balancer type is a different matter: it is fixed at creation. - Every web environment gets a URL
<cname-prefix>.<region>.elasticbeanstalk.com, a CNAME that points at the load balancer (or at the instance's Elastic IP). Your own domain points at it with a Route 53 alias record (see notes/route53-guide.md).
Exam facts
- Load balancer types: Application Load Balancer (HTTP/HTTPS, path rules; required for traffic splitting), Network Load Balancer (TCP/TLS), Classic Load Balancer (previous generation), and a shared ALB that several environments use to cut cost.
- ⚠️ Changed: the console and EB CLI create an ALB by default (
eb create --elb-typedefaults toapplication), and the console's create wizard no longer offers a Classic Load Balancer (the EB CLI, AWS CLI or a clone of a CLB environment still can). The API-level default ofLoadBalancerTypeis stillclassic, so set it explicitly in API or IaC calls. Older material may say the Classic Load Balancer is the default choice. - Pick the load balancer type at creation: later updates can edit listeners, rules and health checks, but never turn a CLB into an ALB or NLB. Moving from CLB to ALB means a new environment plus a URL swap (§8).
- Shared ALB:
LoadBalancerType: applicationandLoadBalancerIsShared: trueinaws:elasticbeanstalk:environment(set at creation through the console, EB CLI or API), plus the ALB's ARN inSharedLoadBalancer(aws:elbv2:loadbalancer). It must be an ALB you created yourself in the same VPC, not one Beanstalk created for another environment; dedicated vs shared can't be changed after creation; inaws:elbv2:listener:<port>onlyRulesapplies; the trigger metricsHealthyHostCount,UnhealthyHostCountandTargetResponseTimearen't available. Beanstalk removes only the rules and processes it added, so you manage the shared load balancer's lifecycle yourself. - An ALB needs subnets in at least two Availability Zones. Dual-stack (IPv4 + IPv6) ALB/NLB is supported with
IpAddressType: dualstack(not single-instance or CLB environments). - HTTPS: add a listener in
aws:elbv2:listener:443withProtocol: HTTPS,SSLCertificateArns(a certificate from ACM or IAM) and optionallySSLPolicy;ListenerEnabled: falseturns off the default port 80 listener. Certificates: see notes/other-services-guide.md (ACM). - Scaling defaults in
aws:autoscaling:asg:MinSize1,MaxSize4,Cooldown360 s. The built-in trigger (aws:autoscaling:trigger) defaults toMeasureNameNetworkOut,StatisticAverage,Period5 min, upper threshold 6,000,000 bytes (+1 instance), lower 2,000,000 bytes (−1). Policy types and health checks: see notes/ec2-mastery-guide.md §10. - Spot:
aws:ec2:instances→EnableSpot: true,InstanceTypes,SpotFleetOnDemandBase(default 0),SpotFleetOnDemandAboveBasePercentage(default 70 load-balanced, 0 single-instance),SpotAllocationStrategy(defaultcapacity-optimized). Spot behaviour: see notes/ec2-mastery-guide.md §5. - ⚠️ Changed: environments in accounts created on or after 2024-10-01 run on EC2 launch templates, because Auto Scaling no longer supports launch configurations there; in older environments, options such as
EnableSpot,DisableIMDSv1: trueor a gp3 root volume migrate the environment to launch templates (no way back). Older material may say Beanstalk launches instances from launch configurations. - ⚠️ Changed: on AL2023 and Windows Server 2022+ platforms,
DisableIMDSv1defaults totrue(IMDSv2 only). Older material may say instances allow both IMDS versions. IMDS details: see notes/ec2-mastery-guide.md §2. - A single-instance environment's Elastic IP is a public IPv4 address, billed hourly like any other (see notes/current-facts.md, ec2 rows).
- After terminating an environment, delete DNS records you created that point at its URL: another account can claim a released CNAME prefix (dangling DNS).
Developer angle
eb create orders-dev --single # one instance with an Elastic IP, no load balancer
eb create orders-prod --elb-type application --min-instances 2 --max-instances 6
eb create reports-prod --elb-type application --shared-lb FrontEndLB --shared-lb-port 443
aws elasticbeanstalk check-dns-availability --cname-prefix orders-prod
HTTPS on the environment's ALB through a configuration file:
# .ebextensions/https.config
option_settings:
aws:elbv2:listener:443:
Protocol: HTTPS
SSLCertificateArns: arn:aws:acm:eu-west-1:111122223333:certificate/0f1e2d3c-4b5a-6978-8a9b-0c1d2e3f4a5b
SSLPolicy: ELBSecurityPolicy-TLS13-1-2-2021-06
aws:autoscaling:asg:
MinSize: 2
MaxSize: 6
Traps
- Trap: "Switch the existing environment's load balancer to an ALB in its settings." → Reality: the type is fixed at creation; create a new environment with an ALB and swap URLs (a clone keeps the old type).
- Trap: "Single-instance environments support rolling deployments." → Reality: only All at once and Immutable (§5); rolling and traffic splitting need a load balancer.
- Trap: "An API-created environment gets an ALB like the console's." → Reality: the API default of
LoadBalancerTypeisclassic; setapplicationexplicitly. - Trap: "Share an NLB across environments." → Reality: only an Application Load Balancer can be shared, and you create it yourself.
- Trap: "Beanstalk deletes the shared load balancer with the last environment." → Reality: you own a shared ALB and manage its lifecycle.
Practice questions
-
A team's production environment was created years ago with a Classic Load Balancer. The application now needs path-based routing that only an Application Load Balancer provides, and the change must not cause downtime. What should the developer do?
- A. Edit the environment's load balancer settings and change the load balancer type to Application Load Balancer.
- B. Clone the environment, deploy the current version to the clone, and then swap the two environments' URLs.
- C. Create an environment with an Application Load Balancer, deploy the current version to it, and swap the URLs.
- D. Add an
.ebextensionsfile that setsLoadBalancerType: applicationand redeploy the current application version.
-
A company runs several low-traffic Elastic Beanstalk web environments, each with its own Application Load Balancer. To reduce cost, the developer plans to move them onto one shared load balancer. Which TWO facts must the plan account for? (Select TWO.)
- A. The shared load balancer must be an Application Load Balancer that the team creates itself, not one created by another environment.
- B. A Network Load Balancer can be shared when each environment listens on a different TCP port.
- C. An existing environment can't be switched to a shared load balancer, so each one must be recreated and its URL swapped.
- D. Environments on a shared load balancer can still scale on the
TargetResponseTimemetric. - E. Elastic Beanstalk deletes the shared load balancer when the last environment that uses it is terminated.
Answers
- C. The load balancer type can only be chosen at creation, so a new environment plus a URL swap avoids downtime. A and D try to change the type in place, which isn't possible; B keeps the Classic Load Balancer because a clone copies the original's load balancer type.
- A, C. Only a self-created ALB can be shared, and dedicated vs shared is fixed when the environment is created. B is wrong because only ALBs can be shared; D is wrong because that metric isn't available with a shared load balancer; E is wrong because you own and manage the shared ALB.
3. Worker environments and periodic tasks
Concept
- A worker environment runs long or blocking jobs (image processing, reports, emails) off the request path. The web tier only enqueues a message with the SDK (
SendMessage), so users don't wait. - Beanstalk manages an SQS queue (or uses one you name) and runs the SQS daemon (
sqsd) on each worker instance. The daemon reads messages and delivers each one as an HTTP POST tohttp://localhost/on port 80, with the message body as the request body. Your worker is just an HTTP app that does the job and answers. - Answer
200 OK→ the daemon deletes the message. Any other status → the message returns to the queue afterErrorVisibilityTimeout; no answer in time → it returns afterInactivityTimeout, ready for another attempt. - Too many failed attempts move the message to a dead-letter queue.
cron.yamladds periodic tasks that the daemon enqueues on a schedule. - A worker environment has no load balancer: clients never call it, work arrives only through the queue. It scales by adding instances to its Auto Scaling group, and every instance runs its own daemon on the same queue.
Exam facts
- Port 80 is fixed (only the path is configurable); the app or its proxy must listen on 80.
aws:elasticbeanstalk:sqsddefaults:HttpPath/·MimeTypeapplication/json·HttpConnections50 (1–100) ·ConnectTimeout5 s ·VisibilityTimeout300 s (0–43,200) ·ErrorVisibilityTimeout2 s ·RetentionPeriod345,600 s = 4 days (60–1,209,600) ·MaxRetries10 (1–100).InactivityTimeout: ⚠️ unverified — the option reference lists 299 s, the worker configuration page 180 s; set it explicitly.- Set
VisibilityTimeout(andInactivityTimeout) longer than your slowest job; otherwise SQS makes the message visible again and a second instance processes the same job. The daemon'sVisibilityTimeoutoverrides the queue's own setting. - An autogenerated queue is a standard queue and gets a dead-letter queue by default. You can't disable it;
MaxRetries100 effectively does.MaxRetriesequals the SQSmaxReceiveCount. With your own queue, configure its DLQ in SQS yourself. - You may bring an existing standard or FIFO queue (
WorkerQueueURL), but periodic tasks aren't supported with a FIFO queue. cron.yamlsits at the root of the source bundle:version: 1, then acronlist ofname(unique),url(path to POST to) andschedule(cron expression, evaluated in UTC). Leader election through a DynamoDB table (AWSEBWorkerCronLeaderRegistry) makes one instance enqueue each task; any instance may process it.- Headers from the daemon:
X-Aws-Sqsd-Msgid,X-Aws-Sqsd-Queue,X-Aws-Sqsd-First-Received-At,X-Aws-Sqsd-Receive-Count,X-Aws-Sqsd-Attr-<name>; periodic tasks addX-Aws-Sqsd-Taskname,X-Aws-Sqsd-Scheduled-At,X-Aws-Sqsd-Sender-Id. - Stack resources:
AWSEBWorkerQueue,AWSEBWorkerDeadLetterQueue,AWSEBWorkerCronLeaderRegistry. The instance profile needsAWSElasticBeanstalkWorkerTier(queue, leader election, periodic tasks). - ⚠️ Changed: the built-in scaling trigger can't measure queue depth. Its metrics are instance and load balancer metrics (default
NetworkOut), and the docs describe CPU-based worker scaling. To scale on backlog, add your own CloudWatch alarm on the queue'sApproximateNumberOfMessagesVisibleand a scaling policy throughResources(§9). Older material may say a worker tier grows and shrinks with its queue backlog on its own. - Messages still in flight when an instance terminates return to the queue for another instance. SQS maximum message size is now 1 MiB (see notes/sqs-sns-kinesis-guide.md); larger payloads go to S3 with a pointer in the message.
- The .NET on Windows Server platform doesn't support worker environments. Create one with
eb create --tier worker(-t worker).
Developer angle
Web tier enqueues (first block); the worker app handles the daemon's POST (second block):
import json, os
import boto3
boto3.client("sqs").send_message(QueueUrl=os.environ["WORKER_QUEUE_URL"],
MessageBody=json.dumps({"imageKey": "uploads/cat.jpg"}))
from flask import Flask, request
application = Flask(__name__)
@application.route("/jobs", methods=["POST"])
def job():
resize(request.get_json()["imageKey"]) # long-running work (your function)
return "", 200 # 200 OK -> the daemon deletes the message
Daemon settings and a nightly task:
# .ebextensions/worker.config
option_settings:
aws:elasticbeanstalk:sqsd:
HttpPath: /jobs
VisibilityTimeout: 900
InactivityTimeout: 840
MaxRetries: 5
# cron.yaml (root of the source bundle)
version: 1
cron:
- name: "nightly-report"
url: "/tasks/report"
schedule: "0 2 * * *"
Traps
- Trap: "Lower
MaxRetriesto stop duplicate processing of long jobs." → Reality: duplicates come from a visibility timeout shorter than the job; raiseVisibilityTimeoutandInactivityTimeout. - Trap: "Use a FIFO queue and keep
cron.yaml." → Reality: periodic tasks aren't supported with a FIFO worker queue. - Trap: "Every instance runs each
cron.yamljob." → Reality: leader election makes one instance enqueue it; one instance processes each message. - Trap: "The worker listens on any port I choose." → Reality: the daemon always posts to port 80; only the path changes.
- Trap: "Run scheduled jobs from
container_commands." → Reality: those run at deployment time, not on a schedule.
Practice questions
-
A worker environment resizes uploaded videos. Some jobs take up to 8 minutes, and the team notices that the same video is sometimes processed twice by different instances. The environment uses the default worker settings. Which change addresses the duplicates?
- A. Lower
MaxRetriesinaws:elasticbeanstalk:sqsdto 1 and redeploy the worker application. - B. Raise
VisibilityTimeoutandInactivityTimeoutinaws:elasticbeanstalk:sqsdabove the longest job time. - C. Replace the autogenerated queue with an existing FIFO queue that uses content-based deduplication.
- D. Raise
HttpConnectionsinaws:elasticbeanstalk:sqsdto 100 and add more instances to the worker environment.
- A. Lower
-
A worker environment already processes jobs from its autogenerated queue. The team must also run a report every night at 02:00 UTC. Which TWO steps are required? (Select TWO.)
- A. Create an Amazon EventBridge schedule that runs the report command on the worker instances at 02:00 UTC.
- B. Point the worker environment at an existing FIFO queue with a single message group for the report.
- C. Add a
cron.yamlfile at the root of the source bundle with the schedule0 2 * * *and aurlfor the report. - D. Add a
container_commandsentry withleader_only: truethat starts the report generation script. - E. Implement an HTTP POST handler at that
urlthat returns200 OKwhen the report completes.
Answers
- B. With the defaults, the message becomes visible again after 300 seconds while the 8-minute job is still running, so a second instance receives it. A only changes how soon a message goes to the dead-letter queue; C doesn't help because FIFO deduplication applies to sends, not to redelivery after a visibility timeout; D increases concurrency without fixing the timeout.
- C, E.
cron.yamldefines the schedule and path, and the worker app must handle the POST and return200 OK. A adds a scheduler and remote command execution that the worker tier already replaces; B breaks periodic tasks, which aren't supported with a FIFO queue; D runs only during deployments, not on a schedule.
4. Platforms and platform updates
Concept
- A platform combines an operating system, a language runtime, a web or application server and the Beanstalk agents. A platform branch is a line of releases sharing those major components (for example, Node.js 24 running on 64bit Amazon Linux 2023); a platform version is one release in the branch, numbered
major.minor.patch. - Staying patched means moving to newer versions within the branch (in place, or automatically with managed updates). Moving to another branch (new runtime major version or new OS) is a blue/green migration.
- When a component reaches end of life, its branch is retired: no more security updates or support, and no new environments for new customers.
Exam facts
- ⚠️ Changed: the current Standard platforms (⚠️ volatile, October 2026) are Docker (Docker running on AL2023 and ECS running on AL2023), Go 1, Java SE (Corretto 8/11/17/21/25), Tomcat (9, 10, 11 with Corretto), .NET Core on Linux (.NET 8, 9, 10 on AL2023), .NET on Windows Server (2019, 2022, 2025 and Core editions, IIS 10.0), Node.js (22, 24), PHP (8.2–8.5), Python (3.11–3.14), Ruby (3.3, 3.4, 4.0). Older material may list the languages with no OS or version, "Java with Tomcat", Packer Builder and three Docker variants.
- ⚠️ Changed: all Amazon Linux 2 branches retired on 2026-08-06, so only AL2023 and Windows Server branches remain (Windows Server 2016 retired 2026-10-08). Older material may say Amazon Linux 2 platforms are current.
- ⚠️ Changed: every Amazon Linux AMI (AL1) branch retired on 2022-07-18, including Single Container Docker, Multicontainer Docker and Preconfigured Docker (GlassFish); custom platforms built with Packer retired with them. Older material may list Packer Builder, Single Container Docker, Multi-container Docker and Preconfigured Docker as available platforms.
- Retired branch policy: no maintenance updates, no technical support, not offered for new environments of new customers; existing customers with active environments get a 90-day grace period. Retired branches disappear from the console but stay usable through the AWS CLI, EB CLI and API for existing environments (clone and rebuild still work).
- In place (same branch): console Change under Platform,
eb upgrade, orupdate-environmentwith the new version; Beanstalk applies the environment's update policy for configuration changes (§6). Blue/green (§8) for a different branch, a new OS (for example AL2 → AL2023) or a major platform version. - Managed platform updates:
aws:elasticbeanstalk:managedactions→ManagedActionsEnabled,PreferredStartTime(weekly window in UTC,day:hour:minute, window lasts 2 hours);aws:elasticbeanstalk:managedactions:platformupdate→UpdateLevelpatchorminor(minor + patch). Never a major version or another branch. - Managed updates are always immutable updates (§7), even when you choose Apply now, and they need enhanced health to judge success.
InstanceRefreshEnabled: truereplaces all instances weekly even without a new platform version. - Console-created environments (since 2019-11-25) have managed updates on by default when enhanced health is on: random weekly window, Minor and patch, instance replacement off. At the API level
ManagedActionsEnableddefaults tofalse. - Managed updates run under the managed-updates service role: the environment's service role, or the service-linked role
AWSServiceRoleForElasticBeanstalkManagedUpdates(ServiceRoleForManagedUpdates). - Custom AMI (
ImageIdinaws:autoscaling:launchconfiguration): start from the platform version's stock AMI to bake software and cut bootstrap time. Platform updates, manual or managed, keep using your custom AMI, so rebuild it for each new platform version. Don't create the AMI from an instance running in a Beanstalk environment. AMI building: see notes/ec2-mastery-guide.md §6. - Replacing instances (managed updates with instance replacement, immutable updates, immutable or traffic-splitting deployments) loses accumulated T-instance burst credits.
Developer angle
eb platform list # platforms available in the Region
eb upgrade # newest version of the current branch, in place
aws elasticbeanstalk describe-platform-version \
--platform-arn "arn:aws:elasticbeanstalk:eu-west-1::platform/Node.js 24 running on 64bit Amazon Linux 2023/6.11.10" \
--query PlatformDescription.CustomAmiList
aws elasticbeanstalk update-environment --environment-name orders-prod \
--options-to-remove Namespace=aws:autoscaling:launchconfiguration,OptionName=ImageId
# .ebextensions/managed-updates.config
option_settings:
aws:elasticbeanstalk:managedactions:
ManagedActionsEnabled: true
PreferredStartTime: "Sun:03:00"
ServiceRoleForManagedUpdates: AWSServiceRoleForElasticBeanstalkManagedUpdates
aws:elasticbeanstalk:managedactions:platformupdate:
UpdateLevel: minor
InstanceRefreshEnabled: false
Mapping older exam wording: Multicontainer Docker → ECS running on AL2023; Single Container Docker → Docker running on AL2023; Java with Tomcat → Tomcat; Packer / custom platform → custom AMI on a managed platform, or a Docker image.
Traps
- Trap: "Managed updates will move us to the next runtime major version." → Reality: patch or minor only, within the branch; a new branch needs blue/green.
- Trap: "Managed updates follow our rolling settings." → Reality: they always run as immutable updates; manual platform changes use your configuration-update policy.
- Trap: "A platform update replaces our custom AMI with the new stock AMI." → Reality: the custom AMI stays; rebuild it from the new stock AMI.
- Trap: "Clone the environment onto the new branch." → Reality: clones only change the version within the same branch.
- Trap: "A retired branch shuts our environment down." → Reality: it keeps running without updates or support; migrate within the grace period.
Practice questions
-
An environment runs on the Node.js 22 running on 64bit Amazon Linux 2023 platform branch and must move to the Node.js 24 branch without downtime. Which approach does Elastic Beanstalk recommend?
- A. Enable managed platform updates with
UpdateLevelset tominorand wait for the next weekly maintenance window. - B. Use the console's platform Change action to select the Node.js 24 branch in the existing environment.
- C. Create an environment on the Node.js 24 branch, deploy and test the app, and then swap the environment URLs.
- D. Clone the environment and choose a Node.js 24 platform version in the clone's settings before swapping URLs.
- A. Enable managed platform updates with
-
A team enables managed platform updates on a production environment. Which TWO outcomes should the team expect? (Select TWO.)
- A. Updates start during a weekly two-hour maintenance window and are applied as immutable updates.
- B. Updates can move the environment to a new major platform version when
UpdateLevelisminor. - C. A custom AMI set in
ImageIdis replaced with the stock AMI of the new platform version. - D. Enhanced health reporting must be enabled for Elastic Beanstalk to judge whether an update succeeded.
- E. Updates are applied batch by batch according to the environment's rolling update settings.
Answers
- C. Changing to another platform branch is a blue/green migration: new environment, test, URL swap. A never crosses branches; B updates only within the current branch; D fails because a clone can only use a version of the same branch.
- A, D. Managed updates run in a 2-hour weekly window as immutable updates and depend on enhanced health. B is wrong because major versions and other branches are never applied; C is wrong because the custom AMI is kept; E is wrong because managed updates are always immutable.
5. Deployment policies compared
Concept
- A deployment puts a new application version on the environment's instances. The deployment policy (
DeploymentPolicyinaws:elasticbeanstalk:command) decides whether existing instances are updated (all at once or in batches) or new instances are launched (immutable, traffic splitting). - Each policy trades speed and cost against availability and rollback safety. The exam names one constraint; pick the policy that wins on it.
- Blue/green isn't a deployment policy but a pattern: deploy to a second environment and swap URLs (§8).
Exam facts
Policy (DeploymentPolicy) |
What happens | Downtime | Capacity during rollout | Extra cost | Failure impact and rollback | Speed |
|---|---|---|---|---|---|---|
All at once (AllAtOnce) |
New version on every existing instance at the same time | Yes, briefly | Out of service briefly | None | Whole environment affected; manual redeploy | Fastest |
Rolling (Rolling) |
One batch at a time on existing instances | No | Reduced by one batch | None | Failed batch out of service, finished batches already new; manual redeploy | Slower (batch size) |
Rolling with additional batch (RollingWithAdditionalBatch) |
Launches an extra batch first, then rolls | No | Full | Small (one batch, temporary) | Minimal if the first batch fails, otherwise like rolling; manual redeploy | Slower still |
Immutable (Immutable) |
Full new set of instances in a temporary Auto Scaling group | No | Full, briefly doubled | High (double capacity for a while) | Minimal; rollback = terminate the new instances | Slowest |
Traffic splitting (TrafficSplitting) |
New instances get a percentage of traffic for an evaluation time | No | Full, doubled during evaluation | High | Only the canary share is affected; rollback = reroute traffic and terminate new instances | Slowest (plus evaluation time) |
| Blue/green (pattern, §8) | New environment, then URL swap | No | Full (two environments) | High | Minimal; rollback = swap back (DNS change) | Slowest |
- Where policies run: single-instance environments support All at once and Immutable only; Rolling and Rolling with additional batch need a load-balanced environment; Traffic splitting needs a load-balanced environment with an Application Load Balancer.
- Defaults: the API default is
AllAtOnce; an environment created with the EB CLI as a scalable (non---single) environment uses rolling deployments; the console sets its own recommended values forDeploymentPolicy,BatchSizeandBatchSizeType, the EB CLI only forBatchSizeandBatchSizeType(notDeploymentPolicy). Those recommended values are applied directly to the environment and override.ebextensions(§9). - Rolling with additional batch deploys to new and existing instances; immutable and traffic splitting deploy only to new instances; all at once and rolling only to existing ones.
- Only immutable, traffic splitting and blue/green avoid a mixed fleet after a failure; with rolling, a failure leaves some instances on the new version.
- Each deployment gets a deployment ID (starting at 1, +1 per deployment or instance configuration change). With enhanced health,
eb healthand the console show it per instance, revealing which instances a failed rolling deployment reached. - Beanstalk Cluster mode (awareness):
strategyRollingUpdate(default) orRecreate(all at once) inaws:elasticbeanstalk:eks:environment:deployment, tuned withmax-surgeandmax-unavailable(defaults 1 and 0, so full capacity) in…:deployment:strategy:rolling; immutable and traffic splitting are Standard-only.
Developer angle
# .ebextensions/deploy-policy.config (takes effect only if the console/EB CLI did not set these options)
option_settings:
aws:elasticbeanstalk:command:
DeploymentPolicy: RollingWithAdditionalBatch
BatchSizeType: Fixed
BatchSize: 2
# Set the policy directly on the environment (highest precedence)
aws elasticbeanstalk update-environment --environment-name orders-prod \
--option-settings Namespace=aws:elasticbeanstalk:command,OptionName=DeploymentPolicy,Value=Immutable
Traps
- Trap: "Rolling is zero-impact." → Reality: capacity drops by one batch while that batch is updated, and a failed batch leaves a mixed fleet.
- Trap: "Rolling with additional batch costs as much as immutable." → Reality: it adds only one batch temporarily; immutable doubles the fleet for a while.
- Trap: "Traffic splitting works with any load balancer." → Reality: it needs an Application Load Balancer and a load-balanced environment.
- Trap: "
DeploymentPolicyin.ebextensionsalways wins." → Reality: a value applied directly to the environment, such as the console's recommendedDeploymentPolicy, takes precedence; remove it or set the policy through the API. - Trap: "Immutable deployments are impossible on a single instance." → Reality: immutable is one of the two policies a single-instance environment supports.
Practice questions
-
A production environment runs 10 instances behind an Application Load Balancer. A new version must be deployed with no downtime and without dropping below full capacity at any point, at the lowest additional instance cost. Which deployment policy should the developer choose?
- A. Rolling
- B. Rolling with additional batch
- C. Immutable
- D. All at once
-
A payments API must deploy in a way that a failed deployment never leaves existing instances running a mix of old and new code, and rollback is as quick as removing the new instances. Which TWO deployment policies meet these requirements? (Select TWO.)
- A. Rolling
- B. Immutable
- C. All at once
- D. Rolling with additional batch
- E. Traffic splitting
Answers
- B. It keeps full capacity by launching one extra batch first, which costs far less than immutable's full second fleet. A drops capacity during each batch; C meets availability but doubles capacity for a while; D causes downtime.
- B, E. Both deploy only to new instances, and rollback terminates them (traffic splitting also reroutes traffic back). A and D update existing instances and can leave a mixed fleet; C updates every existing instance at once and causes downtime.
6. Rolling deployments and configuration updates
Concept
- In a rolling deployment, Beanstalk takes a batch of instances out of the load balancer (draining connections if enabled), installs the new version, puts them back, and waits until they are healthy before the next batch.
- Rolling with additional batch first launches one extra batch on the new version, so serving capacity never dips; when the last batch is done, Beanstalk scales back to the original instance count.
- Separate from deployments, some configuration changes must replace instances: anything in the launch configuration or template (instance type, AMI, key pair) or the VPC settings. They follow the rolling update settings in
aws:autoscaling:updatepolicy:rollingupdate, not the deployment policy. Many other changes (health check URL, environment properties) apply without replacing instances.
Exam facts
- Batch settings (
aws:elasticbeanstalk:command):BatchSizeTypePercentage(default) orFixed;BatchSizedefault 100 (1–100 %, or 1 toMaxSizewhen fixed). Beanstalk reuses this batch size for rolling application restarts, which restart the proxy and application servers without downtime. Timeout(command timeout): default 600 s (1–3,600); Beanstalk adds 240 s internally, so the effective default is 840 s. A batch not healthy in time fails the deployment.IgnoreHealthCheck(defaultfalse):truekeeps going to the next batch after the timeout instead of failing.HealthCheckSuccessThreshold(aws:elasticbeanstalk:healthreporting:system, defaultOk;Warning,Degraded,Severe) lowers the bar for "healthy" during rolling deployments, rolling updates and immutable updates.- The load balancer routes to a reattached instance after it passes its health checks. Without a health check URL a TCP connection to port 80 is enough; with
Application Healthcheck URL(aws:elasticbeanstalk:application, for example/healthorHTTPS:443/health) it must return200 OKto an HTTPGET. - With enhanced health, every instance of a batch must pass 12 consecutive OK checks within 2 minutes (web server) or 18 within 3 minutes (worker) before the batch counts as done.
- Failure: finished batches keep the new version, pending batches keep the old one; roll back by deploying a known good version again. If you terminate instances from the failed deployment, Beanstalk replaces them with instances running the last successful deployment.
- Rolling updates for configuration changes (
aws:autoscaling:updatepolicy:rollingupdate):RollingUpdateEnabled(API defaultfalse; the console and EB CLI set recommended values),RollingUpdateTypeTime(default; waitsPauseTimebetween batches) ·Health(waits for health checks) ·Immutable(§7).MaxBatchSizedefault one third of the Auto Scaling group's minimum size, rounded up;MinInstancesInServicedefault the minimum size or one fewer than the maximum, whichever is lower;TimeoutdefaultPT30M(PT5M–PT1H, ISO 8601).- Rolling updates Disabled: Beanstalk terminates and replaces all instances with no attempt to avoid downtime. Single-instance environments only support Disabled or Immutable.
- A failed rolling update (unlike a failed deployment) starts another rolling update back to the previous configuration. If that rollback fails too (for example at the EC2 instance quota), the environment stays mixed and unhealthy until you fix the cause and update again.
- Two different things share the word "rolling": rolling deployments (new code,
aws:elasticbeanstalk:command) and rolling updates (instance replacement for configuration changes,aws:autoscaling:updatepolicy:rollingupdate).
Developer angle
# .ebextensions/rollout.config
option_settings:
aws:elasticbeanstalk:command:
DeploymentPolicy: Rolling
BatchSizeType: Percentage
BatchSize: 25
Timeout: "900"
IgnoreHealthCheck: false
aws:elasticbeanstalk:healthreporting:system:
SystemType: enhanced
HealthCheckSuccessThreshold: Ok
aws:elasticbeanstalk:application:
Application Healthcheck URL: /health
aws:autoscaling:updatepolicy:rollingupdate:
RollingUpdateEnabled: true
RollingUpdateType: Health
MaxBatchSize: 2
MinInstancesInService: 4
eb health # deployment ID and status per instance
aws elasticbeanstalk update-environment --environment-name orders-prod --version-label v41 # roll back
aws elasticbeanstalk restart-app-server --environment-name orders-prod # restart app servers
Traps
- Trap: "A failed rolling deployment rolls itself back." → Reality: completed batches stay on the new version; you redeploy a known good version.
- Trap: "
BatchSizecontrols instance replacement when I change the instance type." → Reality: that isMaxBatchSizeinaws:autoscaling:updatepolicy:rollingupdate. - Trap: "Changing the instance type restarts the app in place." → Reality: launch configuration changes replace every instance.
- Trap: "Rolling updates disabled still keep some instances serving." → Reality: Disabled replaces everything without protecting availability.
- Trap: "Raise
Timeoutto fix a health check that never passes." → Reality: a longer timeout only delays the failure; fix the health check URL or the app (or lower the threshold knowingly).
Practice questions
-
During a rolling deployment with a batch size of 25 % on an eight-instance environment, the third batch does not become healthy within the command timeout. What is the state of the environment?
- A. Elastic Beanstalk rolls every instance back to the previous version automatically and reports the deployment as aborted.
- B. Elastic Beanstalk terminates the temporary Auto Scaling group and leaves the original instances unchanged.
- C. Every instance runs the new version, because health checks are evaluated only for the first batch.
- D. Finished batches run the new version, pending batches still run the old one, and a manual redeploy rolls back.
-
A developer changes the instance type of an eight-instance production environment from
t3.smalltom7i.large. The change must not cause downtime. Which TWO statements are correct? (Select TWO.)- A. The change replaces all instances, so the settings in
aws:autoscaling:updatepolicy:rollingupdatecontrol it, not the deployment policy. - B. Setting
RollingUpdateTypetoHealthmakes Elastic Beanstalk wait for new instances to pass health checks before it moves to the next batch. - C. Elastic Beanstalk applies the change in place by restarting the application server on each instance.
- D. The
BatchSizeoption inaws:elasticbeanstalk:commandsets how many instances are replaced in each batch. - E. With rolling updates disabled, Elastic Beanstalk still keeps a minimum number of instances in service during the change.
- A. The change replaces all instances, so the settings in
Answers
- D. A rolling deployment that fails leaves finished batches on the new version and pending batches on the old one; rollback is a manual redeploy. A describes behaviour Beanstalk doesn't have; B describes an immutable deployment; C is wrong because every batch must pass health checks.
- A, B. Instance type is a launch configuration setting, so instances are replaced under the rolling update settings, and the
Healthtype waits for health checks. C is wrong because the instances are replaced, not restarted; D is a deployment setting (MaxBatchSizeapplies here); E is wrong because Disabled replaces all instances without avoiding downtime.
7. Immutable and traffic splitting deployments
Concept
- Immutable deployments never touch running instances. Beanstalk creates a temporary Auto Scaling group behind the same load balancer, launches one instance with the new version, and when it is healthy launches the rest to match the current count. When all pass health checks, it moves them into the original group and terminates the old instances and the temporary group.
- Traffic splitting is a canary deployment. Beanstalk launches a full set of new instances in a temporary group, tells the ALB to send a percentage of traffic to them for an evaluation period, and then shifts all traffic and retires the old instances, or moves traffic back and terminates the new ones.
- Both give the fastest and safest rollback, because the old instances keep serving until the new ones prove healthy, at the cost of temporary extra capacity.
Exam facts
- Immutable deployments and immutable updates require enhanced health reporting.
- Capacity briefly doubles: check the EC2 instance quota for large environments (or use rolling updates if you're near it).
- Failed immutable deployment: Beanstalk terminates the temporary group; the original fleet is untouched. Bundle logs from the failed new instances stay in S3 for 1 hour (instead of the usual 15 minutes).
- You can't combine an immutable update with resource configuration changes (for example load balancer settings, or configuration files in the bundle that change settings needing instance replacement): Beanstalk returns an error. Split them into two updates, or use blue/green when they depend on each other. With immutable deployments but non-immutable configuration updates, a version whose config files need a rolling update errors too; use immutable for both (
RollingUpdateType: ImmutableandDeploymentPolicy: Immutable) or a separate update. - Managed platform updates always use immutable updates (§4).
- Traffic splitting options (
aws:elasticbeanstalk:trafficsplitting):NewVersionPercentdefault 10 (1–100) andEvaluationTimedefault 5 minutes (3–600). It needs an Application Load Balancer (the console and EB CLI default) and isn't available on single-instance environments. - During traffic splitting, both Auto Scaling groups hold the same number of instances for the whole evaluation, so a long
EvaluationTimecosts double capacity for longer. - Abort a deployment from the console (Abort current operation) or with
aws elasticbeanstalk abort-environment-update; traffic moves back to the old instances and the new ones are terminated. - Traffic splitting vs blue/green with Route 53 weighted records: traffic splitting keeps one environment and one URL and lets the ALB do the weighting; weighted DNS spans two environments and depends on DNS caching (see notes/route53-guide.md). Lambda canaries are a different feature (CodeDeploy, see notes/sam-guide.md).
Developer angle
# .ebextensions/canary.config
option_settings:
aws:elasticbeanstalk:command:
DeploymentPolicy: TrafficSplitting
aws:elasticbeanstalk:trafficsplitting:
NewVersionPercent: "20"
EvaluationTime: "15"
# .ebextensions/immutable-all.config: immutable for deployments AND configuration changes
option_settings:
aws:autoscaling:updatepolicy:rollingupdate:
RollingUpdateType: Immutable
aws:elasticbeanstalk:command:
DeploymentPolicy: Immutable
aws elasticbeanstalk abort-environment-update --environment-name orders-prod
Traps
- Trap: "Immutable is cheap because the old instances are terminated quickly." → Reality: the fleet is doubled until the new instances pass health checks.
- Trap: "Immutable works with basic health." → Reality: it requires enhanced health reporting.
- Trap: "Ship a config change and an immutable deployment together." → Reality: resource configuration changes can't ride along; do two updates or blue/green.
- Trap: "Traffic splitting needs Route 53." → Reality: the environment's ALB splits the traffic; no DNS change is involved.
- Trap: "Traffic splitting shifts traffic in several steps." → Reality: one initial percentage for the evaluation time, then all traffic (or rollback).
Practice questions
-
A team wants each new version of its API to receive 25 % of production traffic for 30 minutes, roll back automatically if the new instances become unhealthy, and keep the same environment URL without any DNS changes. Which configuration meets these requirements?
- A.
DeploymentPolicy: TrafficSplittingwithNewVersionPercent: "25"andEvaluationTime: "30". - B.
DeploymentPolicy: ImmutablewithHealthCheckSuccessThreshold: WarningandTimeout: "1800". - C. Route 53 weighted records that send 25 % of requests to a cloned environment, with health checks.
- D.
DeploymentPolicy: RollingWithAdditionalBatchwithBatchSize: 25andBatchSizeType: Percentage.
- A.
-
An immutable deployment fails with an error. The source bundle contains
.ebextensionsfiles that change the load balancer idle timeout and the instance type along with the new code. Which TWO actions resolve the problem? (Select TWO.)- A. Set
IgnoreHealthCheck: trueinaws:elasticbeanstalk:commandand retry the immutable deployment. - B. Switch the environment to basic health reporting and retry the immutable deployment.
- C. Apply the configuration changes in a separate environment update, and then deploy the new version.
- D. Create a new environment with the new settings and version, test it, and swap the environment URLs.
- E. Raise the command
Timeoutinaws:elasticbeanstalk:commandto 3,600 seconds and retry.
- A. Set
Answers
- A. Traffic splitting sends the stated share through the environment's ALB for the evaluation time and rolls back automatically. B moves all traffic once instances are healthy, with no canary share; C works but requires two environments and DNS changes; D updates batches of existing instances, which isn't a traffic percentage.
- C, D. Immutable updates can't be combined with resource configuration changes; separate updates fix it, and blue/green fits when the changes depend on each other. A only affects health-check failures; B is wrong because immutable requires enhanced health; E doesn't remove the restriction.
8. Blue green deployments and cloning
Concept
- Blue/green: keep production (blue) untouched, build a second environment (green) with the new version or new settings, test it at its own URL, then swap environment URLs so the production CNAME points at green. Rolling back is swapping again.
- The swap exchanges the two environments' CNAME records at the Beanstalk level instantly, but clients and resolvers can keep cached DNS answers for a while. The old environment must stay up until those expire.
- Cloning creates a new environment from an existing one's configuration, without re-entering option settings and environment variables. It is the usual way to build the green environment or a staging copy.
Exam facts
- Swap tools: console Actions → Swap environment URLs,
eb swap <env> --destination_name <other>,aws elasticbeanstalk swap-environment-cnames --source-environment-name … --destination-environment-name …. IAM actionelasticbeanstalk:SwapEnvironmentCNAMEson both environment ARNs; the condition keyelasticbeanstalk:FromEnvironmentcan exclude protected environments. - Blue/green is required to move to another platform branch or OS, to switch to another kind of load balancer, and for releases whose resource changes can't run alongside the old version. Build the green environment in the same application.
- The database must be independent of both environments (external or decoupled, §11). A database Beanstalk created inside blue is tied to blue's lifecycle.
- Wait for DNS: verify that the old URL reaches green, and don't terminate blue until cached records have expired (resolvers don't always honour TTLs). In the deployment comparison, blue/green is the one method that changes DNS; rollback is Swap URL.
- Gradual shift instead of an instant swap: Route 53 weighted records across the two environments' URLs (see notes/route53-guide.md).
- Beanstalk Cluster environments support CNAME swaps too, and need one to move to different subnets or IAM roles (those can't change on an existing Cluster environment).
- What a clone copies: option settings, environment variables, a load balancer of the same kind with the same settings, and a fresh copy of each associated resource (a coupled database gets the same engine and settings).
- What a clone doesn't copy: RDS data; unmanaged changes made outside Beanstalk; and ingress security groups, which leaves the clone open to all internet traffic until you re-create them.
- ⚠️ Changed: a clone reproduces only what Beanstalk manages; RDS data, unmanaged changes and ingress security groups are not copied. Older material may say a clone keeps every resource and setting of the original.
- A clone can use another version of the same platform branch (the console proposes the recommended one), not another branch.
eb cloneuses the latest version of the branch by default;--exactkeeps the original version. The console clone lets you change the name, URL, description, platform version and service role.
Developer angle
eb clone orders-blue # prompts for the clone's name and CNAME prefix
eb deploy orders-green --version v43 # deploy an existing version to the green environment
eb swap orders-blue --destination_name orders-green
aws elasticbeanstalk swap-environment-cnames \
--source-environment-name orders-blue --destination-environment-name orders-green
Allow swaps between two named environments only:
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": "elasticbeanstalk:SwapEnvironmentCNAMEs",
"Resource": [
"arn:aws:elasticbeanstalk:eu-west-1:111122223333:environment/orders/orders-blue",
"arn:aws:elasticbeanstalk:eu-west-1:111122223333:environment/orders/orders-green"]
}]
}
Traps
- Trap: "Terminate blue right after the swap to save money." → Reality: cached DNS keeps sending some users to blue; wait for the records to expire.
- Trap: "Blue/green works with the database Beanstalk created in blue." → Reality: terminating blue would take that database with it; decouple it first or use an external database.
- Trap: "Clone to change the load balancer type." → Reality: a clone keeps the original type; create a fresh environment instead.
- Trap: "A clone is a full copy, data included." → Reality: RDS data, unmanaged changes and ingress security groups aren't copied.
- Trap: "Swap again to flush DNS caches." → Reality: a second swap rolls back to blue.
Practice questions
-
A team swapped environment URLs from its blue environment to the green one. Thirty minutes later, some users still reach the old version. The team wants every user on green with no errors. What should the team do?
- A. Swap the environment URLs a second time and verify the green environment's URL again.
- B. Terminate the blue environment now and let clients retry until they resolve the green one.
- C. Keep the blue environment running until cached DNS records expire, and then terminate it.
- D. Lower the TTL of the environment's CNAME in the
aws:elasticbeanstalk:environmentnamespace.
-
A developer clones a production environment to create a staging copy. Which TWO items must the developer handle after the clone is created? (Select TWO.)
- A. Re-create the ingress security group rules for the clone.
- B. Re-enter the environment properties in the clone.
- C. Re-select the load balancer type for the clone.
- D. Move the clone to a newer platform branch.
- E. Load the data into the clone's new database.
Answers
- C. The swap changed the CNAMEs, but resolvers and clients keep cached answers for a while, so blue must keep serving until they expire. A rolls back to blue; B breaks the users who still resolve blue; D isn't a setting Beanstalk offers.
- A, E. Ingress security groups and RDS data aren't cloned, so the clone is open to the internet and its new database is empty. B is unnecessary because environment variables are copied; C is unnecessary because the clone keeps the original load balancer type; D isn't possible because a clone stays on the same platform branch.
9. ebextensions and configuration precedence
Concept
- Configuration files let the source bundle carry its own environment configuration: YAML or JSON documents with a
.configextension inside a.ebextensions/folder at the root of the bundle. option_settingssets configuration options by namespace.Resourcesadds or modifies any CloudFormation resource, because those resources join the environment's stack and are created, updated and deleted with it. The Linux keyspackages,groups,users,sources,files,commands,servicesandcontainer_commandsprepare each instance.- The same option can be set in several places; a fixed precedence decides which value wins.
- On Amazon Linux 2 and later platforms (today AL2023),
Buildfile,Procfileand platform hooks (.platform/…) are the preferred way to build and start the app and to run custom scripts;.ebextensionskeepsoption_settingsandResources.
Exam facts
- Files are processed in alphabetical order (
01-…,02-…). Use each top-level key once per file (a duplicate key drops one section). A file with a validation error (for example an invalid key) is skipped entirely and a warning event is logged. YAML must be indented with spaces, never tabs. - Precedence, highest first: (1) settings applied directly to the environment through the API by any client (console, EB CLI, AWS CLI, SDK), including the console's and EB CLI's recommended values → (2) a saved configuration → (3)
.ebextensions→ (4) defaults. - Recommended values the console sets at creation:
IamInstanceProfile,InstanceType,EC2KeyName,RollingUpdateType/RollingUpdateEnabled,DeploymentPolicy,BatchSize/BatchSizeType,ServiceRole,SystemType,HealthCheckSuccessThreshold,Application Healthcheck URL,Notification Endpoint, the worker'sHttpConnectionsand the Classic Load Balancer optionsCrossZone,ConnectionDrainingEnabledandConnectionDrainingTimeout; the EB CLI sets a subset:IamInstanceProfile,InstanceType,RollingUpdateType/RollingUpdateEnabled,BatchSize/BatchSizeType,ServiceRole,SystemType,CrossZoneandConnectionDrainingEnabled, so notDeploymentPolicy. To control them from a file, remove them from the environment first (update-environment --options-to-remove,eb config); the file value then applies. - A setting that exists only in a configuration file can be removed only by deploying a version without it.
commandsrun as root, in alphabetical order by name, before the web server and app are set up and before the version is extracted (default working directory/).container_commandsrun after the version is extracted to the staging directory and before it is deployed; changes they make to staged files ship with the app.leader_only: trueruns a command on one instance, only during environment creation and deployments (not on launch-configuration changes such as a new AMI or instance type);testruns it only when a condition is true (a command usesleader_onlyortest, not both);ignoreErrors: truekeeps a failure from failing the deployment. Output goes tocfn-init-cmd.log.- Anything declared under
Resourceslives in the environment's stack, so terminating the environment removes it too. Resources that must outlive it (a production table, a database) belong outside the environment. Resourcescan reference Beanstalk's own resources by logical name withRef/Fn::GetAtt(for example{"Ref": "AWSEBAutoScalingGroup"}) and read option values withFn::GetOptionSetting. Option values can embed a function between backticks.Procfile(bundle root): long-running processes, onename: commandper line; thewebprocess is the main app, and the proxy forwards to it on port 5000 by default. Beanstalk restarts any process that exits.Buildfile: short build commands that finish.- Platform hooks: executable files in
.platform/hooks/prebuild,predeploy,postdeploy(application deployments) and.platform/confighooks/…(configuration deployments, such as an environment property change). They run as root in lexicographic order, and a non-zero exit aborts the deployment. Platform versions since 2022-04-29 make hook files executable automatically. - Instance order on Linux:
commands→prebuildhooks →Buildfile→ copy of.platform/nginxfiles →container_commands→predeployhooks →Procfileprocesses start → proxy (re)starts →postdeployhooks. - ⚠️ Changed: on Amazon Linux 2 and later platforms (today AL2023), AWS recommends
Buildfile,Procfileand platform hooks overfilesandcommandsin.ebextensionsfor custom code. Older material may use.ebextensionscommands for every customization. - Saved configurations (configuration templates): YAML with
AWSConfigurationTemplateVersion: 1.1.0.0,PlatformorSolutionStack,OptionSettings,EnvironmentTier,Tags. Stored unders3://elasticbeanstalk-<region>-<account>/resources/templates/<app>/. They don't include.ebextensionssettings, and they are available only for Standard environments. - Beanstalk Cluster environments don't use
.ebextensions(there are no instances to customize); dependencies go into the image and settings into--option-settings.
Developer angle
# .ebextensions/01-app.config
option_settings:
aws:elasticbeanstalk:application:environment:
JOBS_TABLE: '`{"Ref" : "JobsTable"}`'
Resources:
JobsTable:
Type: AWS::DynamoDB::Table
Properties:
BillingMode: PAY_PER_REQUEST
AttributeDefinitions:
- AttributeName: jobId
AttributeType: S
KeySchema:
- AttributeName: jobId
KeyType: HASH
container_commands:
01_migrate:
command: "python manage.py migrate --noinput"
leader_only: true
web: gunicorn --bind :5000 app:application
metrics: python metrics_agent.py
#!/bin/bash
# .platform/hooks/predeploy/10-assets.sh: runs on every instance, after container_commands
set -euo pipefail
npm run build
eb config --display # active settings (environment properties excluded)
aws elasticbeanstalk update-environment --environment-name orders-prod \
--options-to-remove Namespace=aws:autoscaling:asg,OptionName=MinSize # let the .ebextensions value apply
eb config save orders-prod --cfg prod-baseline # .elasticbeanstalk/saved_configs/prod-baseline.cfg.yml
eb config put prod-baseline
eb create orders-prod-2 --cfg prod-baseline
Traps
- Trap: "My
.ebextensionsvalue is ignored, so the file is broken." → Reality: a value set directly on the environment (often a console recommended value) outranks it. - Trap: "Run migrations in
commands." → Reality:commandsrun before the version is extracted; usecontainer_commandswithleader_only: true. - Trap: "
leader_onlyruns on every new instance." → Reality: only during environment creation and deployments, on one instance. - Trap: "Name the folder
ebextensionsor the files.yaml." → Reality: the folder is.ebextensionsat the bundle root and files end in.config. - Trap: "A DynamoDB table in
Resourcessurvives environment termination." → Reality: it is part of the environment's stack and is deleted with it. - Trap: "Zipping the project folder in Finder or Explorer keeps
.ebextensions." → Reality: hidden folders and a parent folder are classic packaging mistakes (§13).
Practice questions
-
A developer adds
.ebextensions/scaling.configthat setsMinSize: 2inaws:autoscaling:asg. The environment was created in the console with a minimum of 4 instances and still keeps 4 after the deployment. What explains this behaviour?- A. Configuration files are applied only to environments created with the EB CLI, not to console-created environments.
- B. Settings applied directly to the environment through the console take precedence over configuration files.
- C. Files in
.ebextensionsmust use the.yamlextension; files with other extensions are ignored. - D.
MinSizecan only be changed through a saved configuration, so Elastic Beanstalk discards the file's setting.
-
A Python application must run its database schema migration exactly once per deployment across a six-instance environment, after the new source is extracted and before the new version goes live. Which TWO configuration choices meet this requirement? (Select TWO.)
- A. Define the migration under
commandsin an.ebextensionsfile. - B. Define the migration under
container_commandsin an.ebextensionsfile. - C. Set
leader_only: trueon that command. - D. Put the migration script in
.platform/hooks/postdeploy. - E. Start the migration as the
webprocess in theProcfile.
- A. Define the migration under
Answers
- B. Options set directly on the environment (here, by the console at creation) outrank configuration files. A is wrong because configuration files work with every client; C is wrong because the extension must be
.config; D is wrong becauseMinSizecan be set anywhere, and saved configurations rank above files but below direct settings. - B, C. Container commands run after extraction and before deployment, and
leader_onlylimits the command to one instance. A is wrong becausecommandsrun before extraction; D runs on every instance after the version is live; E is wrong because thewebprocess must be the long-running application.
10. Environment properties and secrets
Concept
- Environment properties are key-value pairs that Beanstalk passes to the application as environment variables: endpoints, feature switches, log levels. The same bundle runs in dev, test and prod with different values.
- Environment secrets are environment variables whose value Beanstalk fetches at instance bootstrap from AWS Secrets Manager or Systems Manager Parameter Store. You store only the ARN in the environment configuration.
- Changing environment properties is a configuration deployment: instances are updated, not replaced (
confighooksrun).
Exam facts
- Set them in the console (Updates, monitoring, and logging → Runtime environment variables, source Plain text), with
eb setenv KEY=value(empty value deletes),eb create --envvars,option_settingsinaws:elasticbeanstalk:application:environment, orupdate-environment --option-settings. - Limits: all properties together ≤ 4,096 bytes (as
key=valuestrings); keys and values are case sensitive; for portability use names matching[A-Z_][A-Z0-9_]*. - Code reads them like environment variables:
process.env.X(Node.js),os.environ["X"](Python),System.getenv("X")(Java SE),$_SERVER['X'](PHP),ENV['X'](Ruby). Tomcat readsSystem.getProperty("X"); platform versions since 2025-03-26 also allowSystem.getenv, and secrets are only visible throughSystem.getenv. - They are passed to the application only;
envin a shell on the instance doesn't show them. Scripts and hooks use theget-configplatform tool.eb configdoesn't display them (eb printenvdoes). - With a coupled database, Beanstalk sets
RDS_HOSTNAME,RDS_PORT,RDS_DB_NAME,RDS_USERNAME,RDS_PASSWORD(§11). Tomcat environments have a placeholderJDBC_CONNECTION_STRING. - ⚠️ Changed: secrets can be mapped straight to environment variables with the
aws:elasticbeanstalk:application:environmentsecretsnamespace (value = Secrets Manager secret ARN or Parameter Store parameter ARN), on platform versions released on or after 2025-03-26. Older material may say to keep secrets in plaintext environment properties or to fetch them yourself in code. - The instance profile role needs
secretsmanager:GetSecretValueorssm:GetParameter, pluskms:Decryptwhen a customer managed key encrypts the secret orSecureString. The console only checks the ARN format, not that the secret exists or that permissions are in place. - Values are fetched at instance bootstrap and are not refreshed automatically when the secret changes. After a rotation, run
UpdateEnvironmentorRestartAppServerso that the running instances fetch them again. New instances from a scale-out pick up the new value right away, so the app must cope with old and new values side by side. - JSON key extraction: append
:<key>to a Secrets Manager ARN (platform versions since 2026-01-13): top-level keys only, not for Parameter Store. - Secrets variables are also available to
container_commandsand platform hooks. Beanstalk adds no charge; normal Secrets Manager and Parameter Store pricing applies. Choosing between the two stores: see notes/security-encryption-guide.md.
Developer angle
# .ebextensions/settings.config
option_settings:
aws:elasticbeanstalk:application:environment:
LOG_LEVEL: info
API_BASE_URL: https://api.example.com
aws:elasticbeanstalk:application:environmentsecrets:
DB_PASSWORD: arn:aws:secretsmanager:eu-west-1:111122223333:secret:orders/db-AbCd12:password
FEATURE_FLAGS: arn:aws:ssm:eu-west-1:111122223333:parameter/orders/flags
Instance profile permissions for those two values:
{
"Version": "2012-10-17",
"Statement": [
{"Effect": "Allow",
"Action": ["secretsmanager:GetSecretValue", "ssm:GetParameter"],
"Resource": ["arn:aws:secretsmanager:eu-west-1:111122223333:secret:orders/db-AbCd12",
"arn:aws:ssm:eu-west-1:111122223333:parameter/orders/flags"]},
{"Effect": "Allow", "Action": "kms:Decrypt",
"Resource": "arn:aws:kms:eu-west-1:111122223333:key/1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d"}
]
}
eb setenv LOG_LEVEL=debug OLD_FLAG= # sets one property, deletes another
eb printenv
aws elasticbeanstalk restart-app-server --environment-name orders-prod # re-fetch rotated secrets
Traps
- Trap: "Grant the secret permissions to the service role." → Reality: the instances fetch the values, so the instance profile role needs them.
- Trap: "Rotated secrets reach the app automatically." → Reality: refresh with
UpdateEnvironmentorRestartAppServer; meanwhile new instances may already hold the new value. - Trap: "Put the database password in
option_settingsof the bundle." → Reality: that is plaintext in source control and S3; use an environment secret. - Trap: "There's no practical size limit." → Reality: 4,096 bytes for all properties combined.
- Trap: "SSH in and run
envto check a value." → Reality: properties are passed to the app only; useget-configoreb printenv.
Practice questions
-
An application reads its database password from the environment variable
DB_PASSWORD. A security review requires that the password no longer appears in plaintext in the environment configuration and that it comes from AWS Secrets Manager, with the fewest code changes. What should the developer do?- A. Keep the value in
aws:elasticbeanstalk:application:environmentand restrict read access to the bundles in the S3 bucket. - B. Grant
secretsmanager:GetSecretValueto the Elastic Beanstalk service role and keep the plaintext property as a fallback value. - C. Rewrite the application to call
GetSecretValuewith the SDK at startup and cache the password in memory. - D. Map
DB_PASSWORDto the secret ARN inaws:elasticbeanstalk:application:environmentsecretsand let the instance role read it.
- A. Keep the value in
-
After a scheduled rotation of a Secrets Manager secret that is configured as an environment secret, the existing instances still use the old value. Which TWO statements are correct? (Select TWO.)
- A. Running
UpdateEnvironmentorRestartAppServermakes the instances fetch the current value. - B. Elastic Beanstalk refreshes environment secrets automatically every 15 minutes.
- C. Rotation events from Secrets Manager trigger an immutable update of the environment.
- D. Instances launched by a scale-out after the rotation receive the new value, so the application must tolerate both values for a while.
- E. Secret values are read only when a new application version is created.
- A. Running
Answers
- D. Environment secrets keep the variable name, so the code doesn't change, and only the ARN is stored; the instances need permission to read the secret. A leaves the password in plaintext; B grants the wrong role and keeps plaintext; C works but needs code changes.
- A, D. Values are fetched at bootstrap and not refreshed automatically; an environment update or app-server restart makes the running instances fetch them again, and newly launched instances already get the new value. B and C describe automation that doesn't exist; E is wrong because instances fetch the values at bootstrap or on an update or restart, not when a version is created.
11. RDS databases and decoupling
Concept
- Beanstalk can create an RDS DB instance coupled to an environment: it provisions it in the environment's stack and passes the connection details as environment properties. That saves wiring work while you prototype or test.
- A production database has to survive blue/green swaps, re-creation and termination of any one environment, so it should be external: created outside Beanstalk, or decoupled from the environment that created it.
- The database deletion policy decides what happens to a coupled database when it is decoupled or when the environment is terminated.
Exam facts
- Coupled engines: MySQL, PostgreSQL, Oracle and SQL Server (
DBEnginedefaultmysql). Other types, such as Aurora, need an external database. Adding a coupled database takes about 10 minutes. - Connection properties:
RDS_HOSTNAME,RDS_PORT,RDS_DB_NAME(database nameebdb),RDS_USERNAME,RDS_PASSWORD.DBUserdefaultebroot;MultiAZDatabasedefaultfalse(Multi-AZ, replicas, RDS Proxy: see notes/rds-guide.md). aws:rds:dbinstance→DBDeletionPolicy:Delete(default; permanent data loss),Snapshot(snapshot, then delete),Retain(database keeps running outside Beanstalk).HasCoupledDatabase:falsestarts decoupling;truecreates a new coupled database (you must supplyDBUserandDBPasswordagain).- ⚠️ Changed: since 2021-10-06 you can decouple a coupled database in place (console Decouple database, or
HasCoupledDatabase: false) without affecting environment health, choosing the outcome with the deletion policy. Older material may say you must snapshot it, turn on RDS deletion protection, build a second environment without a database, swap URLs, retire the original one and then delete its stack left inDELETE_FAILED. - Apply a new
DBDeletionPolicyin its own update before decoupling. Submitted together, the decouple setting wins and the other pending settings are ignored: an oldDeleteorSnapshotpolicy would then destroy the database. - Decoupling time:
Retainusually under 5 minutes;Deleteabout 10–20 minutes;Snapshotdepends on the database size. - Don't change a coupled database directly in the RDS console: environment updates overwrite those settings. Change it through Beanstalk options, or through
Resourcesfor properties Beanstalk doesn't expose (for exampleStorageTypeandIopsonAWSEBRDSDatabase). - External database access: attach a security group to the environment's Auto Scaling group (
SecurityGroupsinaws:autoscaling:launchconfiguration) that the database's group allows. A database rule that references Beanstalk's autogenerated security group creates a dependency that blocks deleting that group when the environment is terminated. - Pass the endpoint and credentials of an external database through environment properties or, better, environment secrets (§10). Several environments can share one external database.
Developer angle
Decouple safely in two separate updates:
aws elasticbeanstalk update-environment --environment-name orders-test \
--option-settings Namespace=aws:rds:dbinstance,OptionName=DBDeletionPolicy,Value=Retain
# wait until the update finishes (Ready), then decouple
aws elasticbeanstalk update-environment --environment-name orders-test \
--option-settings Namespace=aws:rds:dbinstance,OptionName=HasCoupledDatabase,Value=false
Create a test environment with a coupled PostgreSQL database (the EB CLI prompts for the password); the app then reads RDS_HOSTNAME, RDS_PORT, RDS_DB_NAME, RDS_USERNAME and RDS_PASSWORD like any environment variable:
eb create orders-test --database --database.engine postgres --database.username appadmin
Traps
- Trap: "A coupled database is fine for production blue/green." → Reality: terminating or replacing its environment applies the deletion policy to it (default
Delete); decouple it or use an external database. - Trap: "Set the deletion policy to Retain and decouple in one update." → Reality: the pending policy is ignored; apply it first, then decouple.
- Trap: "Turning
HasCoupledDatabaseback on reconnects the old database." → Reality: it creates a new database. - Trap: "Tune the coupled database in the RDS console." → Reality: the environment's settings overwrite those changes on the next update.
- Trap: "Aurora can be added from the environment's Database settings." → Reality: create it outside Beanstalk and pass the endpoint in.
Practice questions
-
A team created an RDS database coupled to its Elastic Beanstalk environment while testing. The environment will be replaced for production, and the database must keep running with minimal downtime and operational effort. What should the developer do?
- A. Set the database deletion policy to Retain and apply it, and then decouple the database in a separate update.
- B. Select Decouple database and change the deletion policy to Retain in the same configuration update.
- C. Snapshot the database, enable deletion protection in RDS, terminate the environment, and delete the stack left in
DELETE_FAILED. - D. Clone the environment and let the clone take over the existing database instance.
-
A production application on Elastic Beanstalk must use an Amazon Aurora PostgreSQL cluster that several environments share. Which TWO steps are required? (Select TWO.)
- A. Add the database in each environment's Database configuration and select the Aurora engine.
- B. Create the Aurora cluster outside Elastic Beanstalk and pass its endpoint in through environment properties or secrets.
- C. Set
HasCoupledDatabase: truein every environment and point each one at the same cluster endpoint. - D. Store the master password in
aws:elasticbeanstalk:application:environmentand read it asRDS_PASSWORD. - E. Allow the database port from a security group that is attached to the environments' Auto Scaling groups.
Answers
- A. Applying
Retainfirst and then decoupling keeps the database running outside Beanstalk without touching the environment. B risks losing the database because the pending policy is ignored; C is the older, longer procedure with more effort and risk; D creates a new, empty database. - B, E. Aurora must be external, with its endpoint passed in, and the database security group must admit the environments' instances. A fails because coupled databases don't support Aurora and belong to one environment; C creates new coupled databases; D stores the password in plaintext.
12. Docker and container environments
Concept
- Containers let you bring any language, version or dependency set. Standard mode offers two Docker branches on AL2023, and Cluster mode is a third container option.
- Docker running on AL2023: Beanstalk builds an image from your
Dockerfileor pulls one you name, and runs one or more containers per instance (Docker Compose for several), behind an nginx proxy. - ECS running on AL2023: Beanstalk creates an Amazon ECS cluster for the environment and runs the same set of containers on every instance from a
Dockerrun.aws.jsonv2 file. It is the migration path from the retired Multicontainer Docker platform. - Beanstalk Cluster (2026): you provide source, a
Dockerfileor an ECR image, and Beanstalk runs replicas on a shared EKS cluster (§1).
Exam facts
| File | Platform branch | Use |
|---|---|---|
Dockerfile |
Docker | Build the image during deployment (needs no .zip when it is the only file) |
Dockerrun.aws.json v1 |
Docker (without Compose) | Pull an existing image; Image.Name, Ports (ContainerPort), Volumes, Logging, Authentication, Entrypoint, Command |
docker-compose.yml (+ Dockerrun.aws.json v3 if needed) |
Docker (with Compose) | Several services on each instance |
Dockerrun.aws.json v2 |
ECS | containerDefinitions turned into an ECS task definition; images must be prebuilt |
- Docker branch: with a
Dockerfilepresent, Beanstalk always builds it and ignores anyImageinDockerrun.aws.json. Only the firstContainerPortis wired to the host proxy, and it should match theDockerfile's firstEXPOSE.Update: "true"(default) pulls the newest image on each deployment.Dockerfile,docker-compose.ymlandDockerrun.aws.jsonmust sit at the root of the.zip. - ECS branch: one ECS cluster per environment, one task per instance, the ECS container agent on each instance, log volumes
awseb-logs-<container>. NoDockerfilebuilds during deployment, so push images to a registry first. A failed ECS task is not rolled back automatically; redeploy a working version. - ⚠️ Changed: Multicontainer Docker (Amazon Linux AMI) retired on 2022-07-18; ECS running on AL2023 runs the same
Dockerrun.aws.jsonv2 with no source changes. Older material may present Multicontainer Docker as the platform for several containers per instance. - ⚠️ Changed: the Docker branch on AL2023 supports several containers per instance through Docker Compose, and Preconfigured Docker (GlassFish) is superseded by it. Older material may say single-container Docker runs exactly one container per instance and list preconfigured Docker platforms.
- AWS recommends the Docker branch unless you are migrating from ECS-based environments, because it is simpler and uses fewer resources.
- Amazon ECR: Beanstalk authenticates automatically with the instance profile. Attach
AmazonEC2ContainerRegistryReadOnlyor a scoped policy (ecr:GetAuthorizationTokenplus pull actions such asecr:BatchGetImageandecr:GetDownloadUrlForLayeron the repository). ECR Public pulls can authenticate withecr-public:GetAuthorizationTokenandsts:GetServiceBearerTokenfor higher rate limits. - Other private registries: a JSON secret in Secrets Manager mapped to environment secrets plus a
prebuildhook runningdocker login(platform versions since 2026-01-13), or the older method of a.dockercfgfile in an S3 bucket in the same Region, referenced byAuthenticationand readable by the instance profile (s3:GetObject). - Instance profile policy for the ECS branch:
AWSElasticBeanstalkMulticontainerDocker. ECS concepts (task roles, services): see notes/containers-guide.md.
Developer angle
{
"AWSEBDockerrunVersion": "1",
"Image": {"Name": "111122223333.dkr.ecr.eu-west-1.amazonaws.com/orders-api:1.4.2", "Update": "true"},
"Ports": [{"ContainerPort": 8080}],
"Logging": "/var/log/orders"
}
{
"AWSEBDockerrunVersion": 2,
"containerDefinitions": [
{"name": "api", "image": "111122223333.dkr.ecr.eu-west-1.amazonaws.com/orders-api:1.4.2",
"essential": true, "memory": 512,
"portMappings": [{"hostPort": 80, "containerPort": 8080}]},
{"name": "proxy-sidecar", "image": "public.ecr.aws/nginx/nginx:stable",
"essential": false, "memory": 128}
]
}
aws iam attach-role-policy --role-name orders-ec2-role \
--policy-arn arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly
eb local run --port 8080 # run the Docker app locally with the EB CLI
Traps
- Trap: "Several containers per instance need the ECS branch." → Reality: the Docker branch on AL2023 runs several with Docker Compose; the ECS branch is mainly the path for old Multicontainer Docker apps.
- Trap: "The ECS branch builds my
Dockerfile." → Reality: it needs prebuilt images in a registry. - Trap: "Store ECR credentials in a
.dockercfgfile." → Reality: ECR uses the instance profile automatically; registry files are for other registries. - Trap: "Put ECR permissions on the service role." → Reality: the instances pull images, so the instance profile needs them.
- Trap: "List several
ContainerPortvalues to expose several ports." → Reality: Beanstalk wires only the first one to the proxy.
Practice questions
-
A team runs its API image from a private Amazon ECR repository on the Docker running on AL2023 platform branch. The team must not store registry credentials anywhere. What should the developer do?
- A. Upload a
.dockercfgfile containing an ECR authorization token to Amazon S3 and reference it in theAuthenticationkey. - B. Add the ECR pull permissions to the Elastic Beanstalk service role and reference the image URI in
Dockerrun.aws.json. - C. Attach
AmazonEC2ContainerRegistryReadOnlyto the instance profile role and use the image URI inDockerrun.aws.json. - D. Run
docker loginin acommandsblock with access keys stored as environment properties.
- A. Upload a
-
A legacy application ran on the retired Multicontainer Docker (Amazon Linux AMI) platform with a
Dockerrun.aws.jsonv2 file that defines three containers. Which TWO statements about migrating it are correct? (Select TWO.)- A. The Docker running on AL2023 branch reads
Dockerrun.aws.jsonv2 files natively. - B. Multicontainer Docker on Amazon Linux AMI can still be selected for new environments in the console.
- C. The ECS running on AL2023 branch accepts the same
Dockerrun.aws.jsonv2 file without source changes. - D. The ECS-based branch needs prebuilt images in a registry, because it can't build a
Dockerfileduring deployment. - E. The ECS-based branch rolls back automatically when an ECS task fails to start.
- A. The Docker running on AL2023 branch reads
Answers
- C. Beanstalk authenticates to ECR with the instance profile, so read-only ECR permissions on that role are enough. A stores a credential file that expires and isn't needed for ECR; B gives the permissions to the wrong role; D places long-term keys in configuration.
- C, D. The ECS branch is the documented migration path for v2 files, and it only pulls prebuilt images. A is wrong because the Docker branch uses v1 or v3 files and Compose; B is wrong because the branch is retired; E is wrong because a failed ECS task isn't rolled back.
13. Source bundles and the lifecycle policy
Concept
- An application version is a labeled pointer to a source bundle stored in S3. Every upload through the console or the EB CLI creates one, and deployments choose a version.
- Versions pile up with every upload. At the Region quota
CreateApplicationVersionfails, so pipelines stop shipping until some versions are deleted. - An application version lifecycle policy deletes old versions automatically, by maximum count or maximum age, when a new version is created.
Exam facts
- Source bundle: a single ZIP or WAR file (a ZIP may contain several WARs), at most 500 MB, with no parent folder at the top level (subfolders are fine). Include hidden folders (
.ebextensions,.platform); a worker with periodic tasks also needscron.yaml. Declare dependencies in the platform's manifest (Node.jspackage.json, Pythonrequirements.txt, PHPcomposer.json, RubyGemfile); Beanstalk reads it and installs the packages on each instance as part of the deployment. - Quota: 1,000 application versions per account per Region across all applications (adjustable). Once at the quota, new versions fail, and the lifecycle policy can't run (it runs only after a successful creation), so delete some versions manually first.
- ⚠️ Changed: the 1,000 figure is a default, adjustable account quota per Region shared by all applications. Older material may say 1,000 versions is a fixed ceiling.
- Rules:
MaxCountRule(Enabled,MaxCount,DeleteSourceFromS3) orMaxAgeRule(Enabled,MaxAgeInDays,DeleteSourceFromS3), plus aServiceRolethat performs the deletions (the defaultaws-elasticbeanstalk-service-roleworks). - ⚠️ Changed: the two rule types are maximum count and maximum age. Older material may call them "based on time" and "based on space".
- When it runs: each time a new version is created, after creating it. The new version doesn't count toward the maximum, and up to 100 versions are deleted per run.
- Never deleted: versions an environment is running, and versions deployed to environments terminated less than 10 weeks before the policy runs.
- Deleting a version keeps its source bundle in S3 unless the rule sets
DeleteSourceFromS3: true(the safe default; opt in to save storage). - With several applications, give each one a policy whose limits add up to less than the Region quota (for example 10 applications × 99 versions). Lifecycle settings exist only for Standard environments.
- EB CLI deploy flow:
eb init→eb create→eb deploy(creates a version from the latest git commit withgit archive, or from the folder contents when.ebignoreexists;--stageduses the git index,--labelnames the version,--versiondeploys an existing one,--processvalidates configuration files first). Pipelines can do the same with the CodePipeline Elastic Beanstalk deploy action (see notes/cicd-guide.md).
Developer angle
cd orders-api
zip ../orders-v42.zip -r * .[^.]* # contents only, hidden folders included, no parent folder
git archive -v -o ../orders-v42.zip --format=zip HEAD # alternative: committed files only
eb init orders --platform "Node.js 24 running on 64bit Amazon Linux 2023" --region eu-west-1
eb deploy --label v42 --message "checkout fix"
eb appversion lifecycle --print
aws elasticbeanstalk update-application-resource-lifecycle --application-name orders \
--resource-lifecycle-config file://lifecycle.json
lifecycle.json:
{
"ServiceRole": "arn:aws:iam::111122223333:role/aws-elasticbeanstalk-service-role",
"VersionLifecycleConfig": {
"MaxCountRule": { "Enabled": true, "MaxCount": 100, "DeleteSourceFromS3": false },
"MaxAgeRule": { "Enabled": false, "MaxAgeInDays": 180, "DeleteSourceFromS3": false }
}
}
Traps
- Trap: "Each application gets 1,000 versions." → Reality: the quota is shared across the Region's applications.
- Trap: "The lifecycle policy deletes versions in use when they are the oldest." → Reality: in-use versions, and versions used in the last 10 weeks by terminated environments, are kept.
- Trap: "Deleting a version also deletes its bundle." → Reality: not by default;
DeleteSourceFromS3is opt-in. - Trap: "Write a scheduled Lambda function to prune versions." → Reality: the built-in lifecycle policy does it with no code.
- Trap: "Zip the project folder itself." → Reality: the archive must not contain a top-level parent folder.
Practice questions
-
A CI pipeline creates a new application version for every commit across 12 Elastic Beanstalk applications in one Region. Deployments start failing because no more versions can be created. What should the team do to prevent this with the LEAST operational overhead?
- A. Request a quota increase to the maximum value and keep every application version indefinitely.
- B. Configure an application version lifecycle policy with a count or age rule on each of the applications.
- C. Write a scheduled AWS Lambda function that calls
DeleteApplicationVersionfor versions older than 30 days. - D. Create a separate Elastic Beanstalk application for each Git branch of the source repository.
-
A developer configures a lifecycle policy with a
MaxCountRuleof 50 andDeleteSourceFromS3set tofalse. Which TWO statements are true? (Select TWO.)- A. Versions that an environment is currently running are not deleted, even when they are the oldest.
- B. Elastic Beanstalk applies the policy once a day, whether or not new versions are created.
- C. The source bundles of deleted versions remain in the Elastic Beanstalk S3 bucket.
- D. The policy needs no IAM role because Elastic Beanstalk deletes versions with the caller's credentials.
- E. The version that is being created counts toward the limit of 50 before older versions are deleted.
Answers
- B. The built-in lifecycle policy prunes versions automatically and keeps the Region-wide total under the quota. A postpones the problem; C works but adds code to build and maintain; D doesn't help because the quota is shared across all applications in the Region.
- A, C. In-use versions are protected, and bundles stay in S3 unless
DeleteSourceFromS3istrue. B is wrong because the policy runs when a version is created; D is wrong because a service role performs the deletions; E is wrong because the new version isn't counted.
14. Health logs and troubleshooting
Concept
- Basic health reflects load balancer health checks and instance status. Enhanced health adds a health agent on each instance that reports requests, latency, errors and resource use, and condenses everything into a colour and a status per instance and per environment.
- Enhanced health underpins immutable updates, managed platform updates and the stricter rolling-batch checks, so production environments should run it.
- Logs stay on the instances until you request them: tail logs (the last 100 lines of the main files) or bundle logs (full files) are uploaded to S3 for download. For retention and search, stream them to CloudWatch Logs.
Exam facts
- Colours and statuses: green OK and Info (operation in progress), yellow Warning, red Degraded and Severe, grey Pending (operation within the command timeout), Unknown (not enough data) and Suspended (Beanstalk stopped monitoring, for example because it can't assume the service role or the Auto Scaling group was deleted).
- Instance health in
eb healthrefreshes every 10 seconds. Failing health checks three times within one minute can downgrade the environment. SystemType(aws:elasticbeanstalk:healthreporting:system): API defaultbasic; the console's configuration presets turn onenhanced(it needs a service role and is off with Custom configuration), and the console and EB CLI setSystemTypeas a recommended value.ConfigDocumentpublishes chosen environment and instance metrics to CloudWatch.- Tail logs = last 100 lines; bundle logs = complete files, including yum, cron and CloudFormation logs. Both go to
elasticbeanstalk-<region>-<account>underresources/environments/logs/…and are deleted after 15 minutes; access is through a presigned URL. The requesting user needss3:DeleteObject(Beanstalk deletes the files with the caller's permissions), whichAWSElasticBeanstalkReadOnlydoesn't grant. - Rotated logs:
LogPublicationControl: true(aws:elasticbeanstalk:hostmanager) uploads rotated logs to S3 about once an hour and keeps them until you delete them; the instance profile needs write access to the bucket. - CloudWatch Logs streaming (
aws:elasticbeanstalk:cloudwatch:logs):StreamLogs(defaultfalse),DeleteOnTerminate(defaultfalse),RetentionInDays(default 7). Log groups are named/aws/elasticbeanstalk/<environment>/…, for example…/var/log/eb-engine.log. Health data streaming is a separate namespace (aws:elasticbeanstalk:cloudwatch:logs:health,HealthStreamingEnabled). - Key instance logs on Amazon Linux platforms:
/var/log/eb-engine.log(deployment steps, including configuration files),/var/log/eb-hooks.log(platform hooks),cfn-init-cmd.log(container commands),/var/log/web.stdout.log(output of thewebprocess), and the nginx or Apache access and error logs. - X-Ray:
XRayEnabled: true(aws:elasticbeanstalk:xray) runs the X-Ray daemon on the instances; the app still needs instrumentation, andAWSElasticBeanstalkWebTierincludes the upload permissions. The X-Ray SDKs and daemon are now in maintenance mode with OpenTelemetry recommended (see notes/current-facts.md, monitoring rows, and notes/monitoring-guide.md). - Events:
eb events/describe-eventsshow what Beanstalk did, including skipped configuration files and failed commands. Notifications go to an email or other endpoint throughaws:elasticbeanstalk:sns:topics, and environment status changes reach Amazon EventBridge. - AI-powered environment analysis (2026, awareness):
eb logs --analyze, orrequest-environment-info/retrieve-environment-infowith--info-type analyze, sends recent logs, events and health to Amazon Bedrock for root causes and fixes. Standard environments need a platform version from 2026-02-26 (Linux) and an instance profile withbedrock:InvokeModel,bedrock:ListFoundationModels,elasticbeanstalk:DescribeEventsandelasticbeanstalk:DescribeEnvironmentHealth. - Reading common failures: a batch that never turns healthy before the command timeout → check the health check URL and the application logs;
Unable to assume role … aws-elasticbeanstalk-service-role→ a missing or broken service role (status Severe, later Suspended); a config file that seems ignored → look for a warning event about invalid keys, or a higher-precedence setting (§9);AccessDeniedfrom the app → permissions missing on the instance profile.
Developer angle
# .ebextensions/observability.config
option_settings:
aws:elasticbeanstalk:healthreporting:system:
SystemType: enhanced
aws:elasticbeanstalk:cloudwatch:logs:
StreamLogs: true
DeleteOnTerminate: false
RetentionInDays: 90
aws:elasticbeanstalk:cloudwatch:logs:health:
HealthStreamingEnabled: true
aws:elasticbeanstalk:xray:
XRayEnabled: true
eb health # colour, status, cause and deployment ID per instance
eb events # recent environment events
eb logs # tail logs of every instance
eb logs --zip # full bundle logs saved under .elasticbeanstalk/logs
eb logs -cw enable # start streaming instance logs to CloudWatch Logs
aws elasticbeanstalk describe-environment-health --environment-name orders-prod --attribute-names All
aws elasticbeanstalk request-environment-info --environment-name orders-prod --info-type bundle
aws elasticbeanstalk retrieve-environment-info --environment-name orders-prod --info-type bundle
Traps
- Trap: "Tail logs are enough to debug a failed deployment." → Reality: they hold only the last 100 lines; request bundle logs for the full files.
- Trap: "Requested logs stay in S3." → Reality: tail and bundle logs are deleted after 15 minutes; use log rotation to S3 or CloudWatch Logs to keep them.
- Trap: "Streaming to CloudWatch Logs keeps logs forever by default." → Reality: retention defaults to 7 days.
- Trap: "
XRayEnabledalone produces traces." → Reality: it runs the daemon; the application must be instrumented. - Trap: "Grey means unhealthy." → Reality: grey is Pending, Unknown or Suspended; red (Degraded, Severe) is unhealthy.
Practice questions
-
A deployment fails and Elastic Beanstalk reports errors on several instances. The developer needs the complete log files from every instance, including
eb-engine.logand the proxy logs, in one download. What should the developer do?- A. Request bundle logs (Full Logs) from the console, or run
eb logs --zip. - B. Request tail logs (Last 100 Lines) from the console for each instance.
- C. Run
eb healthfor the environment and export the per-instance output. - D. Enable
LogPublicationControland wait for the next hourly upload of rotated logs.
- A. Request bundle logs (Full Logs) from the console, or run
-
A team needs instance logs kept for 90 days, even after environments are terminated, and wants to trace requests with AWS X-Ray. Which TWO configuration settings meet these requirements? (Select TWO.)
- A.
aws:elasticbeanstalk:cloudwatch:logs:healthwithHealthStreamingEnabled: true. - B.
aws:elasticbeanstalk:cloudwatch:logswithStreamLogs: true,RetentionInDays: 90andDeleteOnTerminate: false. - C.
aws:elasticbeanstalk:healthreporting:systemwithSystemType: enhancedandEnhancedHealthAuthEnabled: true. - D.
aws:elasticbeanstalk:xraywithXRayEnabled: true, plus instrumentation in the application code. - E. A daily
eb logsrun that downloads tail logs to a developer workstation.
- A.
Answers
- A. Bundle logs package the full log files from every instance into one archive. B returns only the last 100 lines; C shows health status, not logs; D only uploads rotated logs and adds a delay.
- B, D. CloudWatch Logs streaming with 90-day retention, kept after termination, meets the log requirement, and X-Ray needs the daemon plus instrumentation. A streams environment health data, not instance logs; C changes health reporting and sends nothing to X-Ray or CloudWatch Logs; E keeps only tail logs and stores them outside AWS.
Quick decision rules
- If you see "the console asks for an instance profile and the account has none", think create an EC2 role with the Beanstalk managed policies; Beanstalk no longer creates
aws-elasticbeanstalk-ec2-role. - If you see application code that needs AWS access on Beanstalk, think permissions on the instance profile role, never keys in environment properties.
- If you see "restrict a user to one Beanstalk application", think version and environment ARNs with the application in the path plus
elasticbeanstalk:InApplication. - If you see "cheapest environment for dev or test", think single instance (Elastic IP, no load balancer).
- If you see "change the load balancer type of an existing environment", think new environment with the new type and a URL swap (not a clone).
- If you see "several small apps should share one load balancer", think a shared ALB you create, chosen when each environment is created.
- If you see long-running jobs that slow down web requests, think worker environment: the web tier sends to SQS and the worker handles the daemon's POST.
- If you see "jobs processed twice" in a worker, think
VisibilityTimeout(andInactivityTimeout) shorter than the job. - If you see scheduled jobs in a worker, think
cron.yamlwith a standard queue (FIFO doesn't support periodic tasks). - If you see "move to a new runtime major version or OS", think blue/green to a new platform branch.
- If you see "stay patched automatically with no capacity loss", think managed platform updates (weekly window, patch or minor, immutable, enhanced health).
- If you see "fastest deployment, downtime acceptable", think All at once.
- If you see "no downtime, no extra cost, reduced capacity acceptable", think Rolling.
- If you see "no downtime and full capacity at the lowest extra cost", think Rolling with additional batch.
- If you see "new instances only, quickest rollback, no mixed fleet", think Immutable.
- If you see "send X % of traffic to the new version for N minutes", think Traffic splitting (
NewVersionPercent,EvaluationTime, ALB required). - If you see a single-instance environment and a zero-downtime deployment, think Immutable (the only option besides All at once).
- If you see instance type, AMI or key pair changes, think rolling updates (
aws:autoscaling:updatepolicy:rollingupdate), not the deployment policy. - If you see an immutable deployment failing together with resource configuration changes, think two separate updates, or blue/green.
- If you see "users still hit the old version after a URL swap", think DNS caching: keep blue until records expire.
- If you see "staging copy of production", think clone, then re-create ingress security groups and load data.
- If you see an
.ebextensionsvalue that doesn't take effect, think precedence: direct settings (including console recommended values) beat saved configurations, which beat files. - If you see "run once per deployment, after extraction", think
container_commandswithleader_only: true. - If you see extra AWS resources that should ship with the environment, think
Resourcesin.ebextensions, deleted with the environment. - If you see a secret that must come from Secrets Manager or Parameter Store without code changes, think
aws:elasticbeanstalk:application:environmentsecretsplus instance profile permissions. - If you see "rotated secret not picked up", think
UpdateEnvironmentorRestartAppServer. - If you see a production database inside a Beanstalk environment, think decouple it (Retain first, then decouple) or use an external RDS instance.
- If you see several containers per instance from an old Multicontainer Docker app, think ECS running on AL2023 with
Dockerrun.aws.jsonv2. - If you see a private ECR image, think instance profile with ECR read permissions; no credentials to store.
- If you see "cannot create new application versions", think lifecycle policy (count or age); the quota is shared across the Region.
- If you see "full logs from every instance", think bundle logs; for retention, CloudWatch Logs streaming.
Changed vs older material
Learn the Current column; older practice material may still show the Course / older material value. Values were checked on 2026-10-12.
| Topic | Course / older material | Current (verified 2026-10-12) | Source |
|---|---|---|---|
| §1 · Compute modes | Beanstalk always runs your code on EC2 instances in its own Auto Scaling group | Two modes: Standard (EC2) and Cluster (containers on a shared Amazon EKS cluster with EKS Auto Mode), since 2026-09-17 | AWS docs |
| §1 · Default EC2 instance profile | The console creates aws-elasticbeanstalk-ec2-role on the first environment |
No longer created; create a role trusted by ec2.amazonaws.com with the Beanstalk managed policies |
AWS docs |
| §1 · Managed user policies | AWSElasticBeanstalkFullAccess, AWSElasticBeanstalkReadOnlyAccess; service policy AWSElasticBeanstalkService |
AdministratorAccess-AWSElasticBeanstalk, AWSElasticBeanstalkReadOnly; service policy AWSElasticBeanstalkManagedUpdatesCustomerRolePolicy |
AWS docs |
| §2 · Default load balancer | Classic Load Balancer as the default or a console choice | ALB by default in the console and EB CLI; CLB disabled in the console create wizard; API default of LoadBalancerType still classic |
AWS docs |
| §2 · Launch configurations | Instances launch from Auto Scaling launch configurations | Accounts created on or after 2024-10-01 use launch templates; some options migrate older environments to them | AWS docs |
| §2 · IMDSv1 on instances | Both IMDS versions enabled | AL2023 and Windows Server 2022+: DisableIMDSv1 defaults to true (IMDSv2 only) |
AWS docs |
| §3 · Worker scaling | A worker tier follows its queue backlog by itself | Built-in triggers use instance/load balancer metrics (default NetworkOut; docs describe CPU-based worker scaling); queue-depth scaling needs your own CloudWatch alarm and policy |
AWS docs |
| §4 · Platform list | Language platforms with no OS or versions given (Go, Java SE, Java with Tomcat, .NET Core on Linux, .NET on Windows Server, Node.js, PHP, Python, Ruby) | AL2023 branches for Docker, ECS, Go, Java SE (Corretto), Tomcat, .NET Core on Linux, Node.js, PHP, Python, Ruby, plus .NET on Windows Server 2019/2022/2025 (⚠️ volatile) | AWS docs |
| §4 · Custom platforms (Packer) | Supported platform | Retired 2022-07-18 with all Amazon Linux AMI branches; use a custom AMI or a Docker image | AWS docs |
| §4 · Amazon Linux 2 branches | Current platforms | All retired 2026-08-06; only AL2023 and Windows Server branches remain (Windows Server 2016 retired 2026-10-08) | AWS docs |
| §8 · Cloning | A clone keeps every resource and setting | Only Beanstalk-managed settings; RDS data, unmanaged changes and ingress security groups aren't copied; same platform branch only | AWS docs |
| §9 · Instance customization | .ebextensions commands and files for every customization |
Amazon Linux 2 and later (AL2023 today): prefer Buildfile, Procfile and platform hooks |
AWS docs |
| §10 · Secrets | Plaintext environment properties or SDK calls in code | aws:elasticbeanstalk:application:environmentsecrets maps Secrets Manager / Parameter Store ARNs to variables (platform versions from 2025-03-26; JSON keys from 2026-01-13) |
AWS docs |
| §11 · Decoupling RDS | Snapshot, deletion protection, new environment, URL swap, terminate, delete the DELETE_FAILED stack |
Decouple in place (console or HasCoupledDatabase: false) with DBDeletionPolicy Retain/Snapshot/Delete, since 2021-10-06 |
AWS docs |
| §12 · Several containers per instance | Multicontainer Docker platform | ECS running on AL2023 (same Dockerrun.aws.json v2), or Docker Compose on Docker running on AL2023 |
AWS docs |
| §12 · Single-container and preconfigured Docker | One container per instance; preconfigured GlassFish/Go/Python Docker platforms | Docker running on AL2023 runs one or more containers; preconfigured Docker superseded | AWS docs |
| §13 · Version quota | 1,000 versions is a fixed ceiling | 1,000 is the default account quota per Region, shared by all applications, adjustable | AWS docs |
| §13 · Lifecycle rules | Rules based on time or on space | Maximum count or maximum age; up to 100 deletions per run; in-use versions and versions used in the last 10 weeks are kept; bundles kept in S3 by default | AWS docs |