Elastic Beanstalk Flashcards
What is Elastic Beanstalk?
Elastic beanstalk is a developer centric view of deploying an app on AWS. Managed service for handling provisioning of AWS components.
What is the difference between the Web Server Tier and the Worker Tier in Elastic Beanstalk?
Web server tier is a standard web app environment (ELB, auto scaling group, EC2 instances). A worker tier is for processing queues using SQS, auto scaling group and EC2 instances.
What are the two main deployment modes with Elastic Beanstalk?
Single instance (good for development) has an elastic ip. High availability with load balancer (good for prod).
In elastic beanstalk what are the 6 deployment options for updates?
All at once (deploy all in one go). Rolling. Rolling with additional batches. Immutable (new auto scaling group). Blue-Green. Traffic splitting (canary testing).
What happens during an “all at once” elastic beanstalk deployment?
All application instances are stopped, new version deployed and all app instances starts. Very fast, but has downtime, no additional cost.
What happens during a “rolling” elastic beanstalk deployment?
A specified number of app instances (called the bucket) are stopped and updated. After the first bucket the next bucket / set of instances are updated. Multiple versions running during deployment, no additional cost.
What happens during a “rolling with additional batches” elastic beanstalk deployment?
Similar to rolling but the number of running instances will surge. Small additional cost, additional batch is removed at the end. This ensures that there are always the required number of instances running during the deployment. Good for prod.
What happens during an “immutable” elastic beanstalk deployment?
New version of the app is deployed onto new EC2 instances on a temporary auto scaling group. Zero downtime, double the cost, but has very quick rollback. One initial instance created, once healthy all new instances spun up. Then they are moved into the auto scaling group, and old versions terminated.
What is the “blue green” elastic beanstalk concept?
Not a direct feature of elastic beanstalk, you create a new environment and deploy the new version there. Then use something like route53 to redirect some traffic to test using a weighted policy. Then using beanstalk “swap urls” when ready.
What is the “traffic splitting” elastic beanstalk deployment?
Used for canary testing. The new version is deployed to a temporary auto scaling group (with the same capacity). A % of traffic sent to the temporary ASG (new version) using the ALB. Deployment health is monitored. If failures automatic and very quick rollback. No downtime. When ready new instances migrated to the original ASG.
What is the beanstalk lifecycle policy?
Defines how to phase out old app versions, beanstalk can store up to 1000 app versions. Policy can be based on time or based on space. Versions currently used won’t be deleted.
What are elastic beanstalk extensions?
Files containing parameters for EB. Must be in the .ebextensions/ directory in the root of source code. Must be in YAML or JSON. File extension must end with *.config. Able to modify some default settings. Ability to add resources such as RDS, ElastiCache etc
What is cloud formation?
Used to provision AWS services, elastic beanstalk uses it to perform a lot of its operations.
When cloning an elastic beanstalk environment would the data within a RDS database be cloned?
No
After creating an elastic beanstalk environment can you change the type of the ELB?
No, you can only change the configuration
How would you perform a elastic beanstalk migration (for example changing the type of the ELB from classic to app load balancer)?
Create a new EB environment with the same config except the LB. You cannot use the clone. Deploy the app to the environment. Perform a CNAME swap or route53 update.
Should you use RDS databases within a prod elastic beanstalk environment?
Generally speaking no, it is best to separately create them. This is because the database lifecycle is tied to the beanstalk environment lifecycle.
How would you de-couple a RDS database from an EB environment?
Create a snapshot of the RDS. In the RDS console protect the database from deletion. Create a new EB environment without the RDS, instead point the app to the existing RDS. Perform DNS update. Terminate the old EB environment (RDS won’t be deleted). Delete the cloud formation stack (stuck in deleted_failed state).
A company hosting their website on AWS Elastic Beanstalk. They want a methodology to continuously release new application versions with the ability to roll back very quickly in case if there’re any issues. Also, the application must be running at full capacity while releasing new versions. Which Elastic Beanstalk deployment option do you recommend? - All at once. Rolling. Rolling with additional batches. Immutable.
Immutable.
Your deployments on Elastic Beanstalk have been painfully slow. After checking the logs, you realize that this is due to the fact that your application dependencies are resolved on each instance each time you deploy. What can you do to speed up the deployment process with minimal impact?
Resolve the dependencies beforehand and package them in the zip file uploaded to elastic beanstalk.
For an elastic beanstalk extension file what should its extension be and where should it be placed?
Must have a .config extension and must be placed in the .ebextensions folder at the root of the code zip
In cloud formation how would you use a resource that isn’t supported yet?
Use cloud formation custom resources
By default what happens when a cloud formation stack creation fails?
Everything rolls back and gets deleted
By default what happens when an update to a cloud formation stack fails?
The updates roll back to the last previously known working state