/Elastic Beanstalk
Concept Detail

Elastic Beanstalk

Difficulty: medium

Overview


AWS Elastic Beanstalk is a PaaS that handles infrastructure, deployment, load balancing, and auto scaling.

Environment Types:

  • Web Server: ALB + EC2 + ASG.
  • Worker: SQS + EC2 + daemon. Long-running tasks. cron.yaml for scheduling.

Deployment Policies:

PolicyDowntimeExtra Cost
All at OnceYesNo
RollingNoNo
Rolling with additional batchNoYes (temp)
ImmutableNoYes (double)
Traffic splitting (Canary)NoYes (temp)
Blue/GreenNoYes (double env)

Blue/Green: Create separate environment → deploy → Swap Environment URLs → instant switch. Rollback: swap back.

.ebextensions: YAML/JSON config files in .ebextensions/ directory. Install packages, run commands, configure environment. Processed alphabetically.

Managed Platform Updates: Automatic OS/runtime patches in a maintenance window.

Practice Linked Questions


medium

Q1. A developer deploys a web app on AWS Elastic Beanstalk. They want to deploy a new version with zero downtime, while keeping the same number of instances running. Which deployment policy should they choose?


Select one answer before revealing.

medium

Q2. A developer uses Elastic Beanstalk and needs to run a custom script to install a library on EC2 instances before the application starts. Where should this script be placed?


Select one answer before revealing.

easy

Q3. After deploying a new Elastic Beanstalk application version, a developer discovers a critical bug. They need to immediately restore the previous working version. What should the developer do?


Select one answer before revealing.