Elastic Beanstalk Flashcards
What is Elastic Beanstalk?
- A managed AWS service that provides a developer centric view of deploying a web application on AWS.
- Provides the developer with a central location to obtain all necessary resources (i.e. ALB, EC2, RDS etc) for an application.
- Relies on AWS CloudFormation under the hood to provision other AWS services.
What is the cost of Elastic Beanstalk?
Elastic Beanstalk is free, but the underlying services (i.e EC2) are paid for
What are the three components of Elastic Beanstalk?
- Application
- Application Version
- Environment (dev, at, prod)
What are the four deployment options for Beanstalk updates?
- All at Once
- Rolling
- Rolling with additional batches
- Immutable
What is an ‘All at Once’ deployment on Beanstalk?
This is the fastest deployment types, but there is downtime.. Good for development environment.
What is a ‘Rolling’ deployment on Beanstalk?
- Update a few instances at a time (called buckets), and then move on to the next bucket when the current one is healthy.
- Application runs below capacity.
- Both old and new versions will run simultaneously.
- No additional cost.
- Long deployment.
What is a ‘Rolling with Additional Batches’ deployment on Beanstalk?
This is like the rolling deployment but it launches new instances to move the batch. This means that the application remains running at capacity, but still has both the old and new versions running at the same time.
Cost a little more because of the additional instances to keep app at capacity.
Good for production environment.
What is an ‘Immutable’ deployment on Elastic Beanstalk?
- Spins up new instances in a new ASG, deploys new version to these instances and then swaps all the instances when the new version instances are all healthy.
- No downtime.
- High cost because it doubles the capacity.
- Longest deployment.
- Great for production.
Describe Blue / Green Deployment in Elastic Beanstalk.
- Not a direct feature of Beanstalk but may be on the exam.
- Zero downtime and release facility.
- Create a new ‘stage’ environment (green) an deploy new version there.
- Setup Route 53 (weighted) to direct a certain % of traffic to new green / staged environment.
- If new version fails can be rolled back easily.
- If it passes, can use ‘URL Swap’ feature in Beanstalk to swap old version (blue) URL with the new version (green) url.
Describe the basic deployment process for elastic beanstalk (regardless if deployment method).
- Describe dependencies (i.e NodeJS)
- Package code as zipfile
- Upload zipfile (creates a new app version)
- Deploy code- elastic beanstalk will deploy the zip onto each EC2 instance, resolve dependencies and start the application.
What are Beanstalk lifecycle policies?
- Life cycle policies in beanstalk can be based on time or space used.
- Point is to delete OLDER versions of the application so that new versions can be continually deployed.
- There is an option to store old bundles in an S3 bucket so that they are still archived.
How many application versions can be stored on Elastic Beanstalk?
- Once this max is reached, new applications can not be deployed. To deal with this, set life cycle policies.
Can the load balancer type be changed in Elastic Beanstalk once the environment is created?
No. If the load balancer type needs to be changed, you can choose to migrate the existing application. To migrate a beanstalk application, create a new environment with the same config as current (can not clone), deploy app to new environment, perform CNAME swap or route53 update.
What are the 2 main environments in Elastic Beanstalk?
- Web Environment (Single Instances or Load Balanced)
- Worker Environment (creates 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).
What is the purpose of .ebextensions directory in an elastic beanstalk project?
- All of the parameters that can be set in the Elastic Beanstalk UI can be defined in config files. These config files must live in a .ebextensions directory.
- Each file within this directory should end with .config
- Files can be YAML or JSON