Elastic Beanstalk Flashcards
EB
- use all aws components together, automatically handles capacity provisioning, load balancing, scaling, etc
- allows the dev to focus on actually coding!
- can easily clone environments
- uses CloudFormation under the hood
EB components
- application - collection of beanstalk components
- app version - iteration of you app code
- environment - collection of aws resources running an app version (dev, test, prod)
- tiers
- web server tier
- worker environment tier - sqs queue
- can combing web server and worker env
- tiers
EB Deployment modes
- single instance - great for dev
- DNS name → elastic IP
- high availability w/ load balancer - great for prod
- DNS name → ELB DNS name
All at once Deployment
(deploy all in one go) - fastest but instances aren’t available to serve traffic for a bit
Rolling Deployment
update a few instances at a time (bucket) and then move onto the next bucket once first bucket is healthy
Rolling with additional batches deployment
rolling but spins up new instances to move the batch (so that the old app is still available)
Immutable
spins up new instances in a new ASG, deploys version to these instances, then swaps all instances when everything is healthy. Original instances in old asg remain untouched until deployment is complete.
blue/green deployment
swap CNAME (environment URLs)
Canary Deployment
traffic splitting between ASGs
Deployment method overview
EB extension
- parameters set in UI can be configured in code using files
- .ebextensions directory in root of source code
- contains .config extensions (logging.config)
- anything under ebextensions gets deleted with the environment
EB load balancer migration
- after env creation, you cannot change the ELB type (only configuration)
- steps
- create new env with same configuration except LB
- deploy app to new env
- perform CNAME swap or Route 53 update
EB w/ Docker
- can run an app as a single docker container
- beanstalk in single docker container does NOT use ECS
- multi docker containers per ec2 instance
- requires a dockerrun.aws.json at root of source code - used to generate task defintion in ECS
- image must be pre-built and stored in a repo somewhere