Elastic Beanstalk Flashcards
Elastic Beanstalk
- Uses all components such as EC2, ASG, ELB, RDS
- Managed service with instance configuration
- deployment strategy is configurable but performed by Elastic Beanstalk
- the developer is responsible for the only the code.
Elastic Beanstalk
3 Architecture Model
- single instance deployment; good for development
- LB + ASG great for production or pre-production ; web applications
- ASG only; great for non-web apps in production (workers)
Elastic Beanstalk
Deployment modes for Updates
- All-at-once
- Rolling
- Rolling with additional Batch
- Immutable
Elastic Beanstalk
Deployment Mode: All-at-Once
‣ Deploy the new to all instances all at once
‣ Fastest, but instances aren’t available to serve traffic
‣ No additional costs
‣ Yes Downtime
Elastic Beanstalk
Deployment Mode: Rolling
‣ Deploy new version in batches ‣ Application is running below capacity ‣ Update a few instances at a time (bucket), and then move onto the next bucket once the first bucket is healthy ‣ No additional costs ‣ Long deployments ‣ NO downtime
Elastic Beanstalk
Rolling with additional Batch
‣ Deploy new version in batches but first launch new batch of instances
‣ Like rolling but spines up new instances to move the batch (so that the old application is still available)
‣ Application is running at capacity
‣ Application is running both version simultaneously
‣ Additional batch is removed at the end of the deployment
‣ Longer deployment
‣ Good for production
‣ NO downtime
Elastic Beanstalk
Deployment Mode: Immutable
‣ Deploy new version to a fresh group ‣ Spins up new instances in a new ASG, deploys version to these instances and then swaps all the instances when everything is healthy ‣ Zero downtime ‣ High cost, double the capacity ‣ Longest deployment ‣ Quick rollback in case of failures; just terminate the new ASG ‣ Great for production ‣ NO downtime
Beanstalk Lifecycle Policy
- 1000 application version max
- if you don’t remove old ones new ones can’t be deployed
- to phase out old application version
Elastic Beanstalk Extensions
- files must be in the .ebextensions/ directory in the root of the source code
- YAML / JSON format
- .config extensions
- able to modify some default extensions with option_settings
- resources managed by .ebextensions get deleted if the environment gets deleted.
Beanstalk & CloudFormation
- under the hood Elastic Beanstalk uses CloudFormation
Elastic Beanstalk Cloning
- clone an environment with the same exact configuration
- all resources and configurations are preserved
- LB type and config
- RDS DB type
- Environment Variables
- after cloning you can change the settings