This article is the seventh in a series covering my AWS DevOps Professional certification study process, part 6 is here.
AWS Elastic Beanstalk is service for deploying and scaling web applications and services developed with Java, .NET, PHP, Node.js, Python, Ruby, Go, and Docker..
Upload your code and Elastic Beanstalk automatically handles the deployment, capacity provisioning, load balancing, auto-scaling & application health monitoring.
How to install the EB CLI (it’s a pip install, don’t forget to add to PATH)
Watch this re:Invent video – Manage Your Applications with AWS Elastic Beanstalk (DEV305)
Do the Getting Started section of the user guide:
Read the DevOps blog article Using the Elastic Beanstalk (EB) CLI to create, manage, and share environment configuration. EB saved configs are great for moving/copying an app to a new region.
- Know EB Config option precedence:
- Settings applied directly to env
- Saved configs
- .ebextensions .config files
- Default values
If you want a resource to outlive an EB deployment (DB, RDS, etc…) you should create it outside of the EB env and reference it using env properties or ebextensions.
The application version lifecycle policy allows you to limit by # of application versions or age:
EB Managed updates gives AWS a window to allow platform patching.:
- EB Deployment Modes:
- All at once – requires application downtime
- Rolling – can set bucket size (# of instances to be upgraded @ the same time)
- Rolling w/ additional batches – (1st bucket is created new for upgrade window)
- good for running at capacity, incurs additional cost temporarily
- Immutable – new instances in new ASG
- doubles capacity temporarily
- longest deployment
- quick rollback in case of failures
- Traffic Splitting
- immutable w/ forwarding a % of the traffic to the new instances for a certain amount of time
- If instances stay healthy then fwd all traffic & shutdown old env
You can swap env URLs between environments. Relies on R53 so it’s not instant or comprehensive, will take time to propagate. You can NOT do %-base cutovers this way, it’s all or nothing:
- Worker queue decouples work between web tier and worker tier
- used for processing long running jobs via SQS
- cron.yaml defines cron jobs that run in the worker env
Dockerrun.aws.json is an EB specific JSON file that describes how to deploy a set of Docker containers as an EB app.