Elastic Beanstalk Cheat Sheet
This cheat sheet is based on the AWS Certified Developer Associate walk through by Andrew Brown. Originally I wrote down the cheat sheet from his presentation. However, I thought maybe others might have a use for the same cheat sheet in a searchable format. I really encourage you to watch his walk through over at YouTube.
- Elastic beanstalk handles the deployment, from capacity provisioning, load balancing, auto-scaling to application health monitoring
- When you want to run a web-application but you don't want to have to think about the underlying infrastructure
- It costs nothing to use Elastic Beanstalk (only the resources it provisions. Eg. RDS, ELB and EC2)
- Recommended for test or development apps. Not recommended for production use
- You can choose from the following preconfigured platforms: Java, .NET, PHP, Node.js, Python, Ruby, Go and Docker
- You can run containers on EB either in Single-container or Multi-container, these containers are running on ECS instead of EC2
- You can launch either a Web Environment or a Worker Environment
- Web Enivorments come in two types Single-Instance or Load Balanced
- Single-Instance Env launches a single EC2 instance, an EIP is assigned to the EC2
- Load Balanced Env launch EC2s behind an ELB managed by an ASG
- Worker Environments creates an SQS queue, installs the SQS daemon on the EC2 instances, and has ASG scaling policy which will add or remove instances based on queue size
- EB has the following Deployment Policies:
- All at once - takes all servers out-of-service, applies changes, puts servers back-in-service. Fast, but has downtime
- Rolling - updates servers in batches, reduced capacity based on batch size
- Rolling with additional batch - adds new servers in batches to replace old, never reduces capacity
- Immutable - creates the same amount of servers, and switches all at once to new servers, removing old servers
- Rollback deployment policies require an ELB, so cannot be used with Single-Instance Web Environments
- In-Place deployment is when deployment occurs within the environment, all deployment policies are In-Place
- Blue/Green is when deployment swaps environments (outside an environment). When you have external resources such as RDS which cannot be destroyed its suited for blue/green
.ebextensions
is a folder which contains all configuration files- With EB you can provide a Custom Image which can improve provisioning times
- If you let Elastic Beanstalk create the RDS instance, that means when you delete your environment it will delete the database. This setup is intended for development and test environments
Dockerrun.aws.json
is similar to a ECS Task Definition, and is used to define multi container configurations
Credits
Andrew Brown from ExamPro