Section 8: AWS Elastic Beanstalk Flashcards
What does AWS Elastic Beanstalk allow you to do?
Deploy application in AWS safely, predictably, without having to worry about managing infrastructures directly.
What does AWS EB uses under the hood?
CloudFormation
What components does AWS EB leverages?
EC2, ASG, ELB, EBS, RDS, etc.
How can you customize your infrastructure when using AWS EB?
By modifying the configuration in the beautiful dashboard the service provides.
What is the pricing of AWS EB?
Itโs free, you only pay for the underlying resources.
What is the responsibility of the developer when using AWS EB?
Providing the application code
Who manages deployments when using AWS EB?
The developer is responsible for choosing his preferred deployment strategy and provide his code. The deployment itself is handled by AWS EB.
What type of web architecture does AWS EB facilites the management of?
The typical 3-tier web app architecture
What are the three architecture models when deploying an app to EB?
Single instance (good for dev) LB + ASG (good for prod web apps) ASG only (good for workers)
What are the three important concepts to understand in apps managed by AWS EB? (Think about the GUI of the EB console)
Application itself
Application version
Environment name
What is the naming convention for EB environment name?
Free naming
Where do you deploy application versions to in EB?
To environments (E.g. You deploy to dev)
Where can you promote application versions to in EB?
To environments (E.g. You promote from dev to prod)
Can you rollback to previous application versions in EB?
Yes
What platforms does EB support?
Go Java SE Java with Tomcat .NET (Windows Server with IIS) Node.JS PHP Python Ruby Packer Build Single Container Docker Multicontainer Docker Preconfigured Docker
What should you do if EB does not support your platform?
You create a custom one
What are the available deployment methods in EB?
All at once Rolling Rolling with additional batches Immutable Blue/Green
What is the fastest deployment method in EB?
All at once
What are the longest deployment method in EB?
Immutable and Blue/Green
Which deployment methods incur additional charges in EB?
Rolling with batches
Immutable
Blue/Green
How does the Immutable deployment method works in EB?
New instances are spin up in a new temporary ASG
The new version of the app is deployed to these new instances
When everything is healthy, new instances are transferred to the main ASG
Old instances are shutdown as well as the temporary ASG
How does the Blue/Green deployment works in EB?
Similar to Immutable, but rather than having a new ASG, you get a completely new โstageโ environment, and the DNS (Route 53) is responsible for sending a fraction of the traffic to the new environment. When the new environment is good to go and approved, the DNS start sending all of the traffic to the new stage which can be renamed to โprodโ for convenience if desired.
What is the rollback process of the โAll at onceโ deployment method?
Manual Redeploy
What is the rollback process of the โRollingโ deployment method?
Manual Redeploy
What is the rollback process of the โRolling with additional batchโ deployment method?
Manual Redeploy
What is the rollback process of the โImmutableโ deployment method?
Terminate New Instances
What is the rollback process of the โBlue/Greenโ deployment method?
Swap URL
To which instances is the code deployed to in the โAll at onceโ deployment method?
Existing instances
Where is the code deployed to in the โRollingโ deployment method?
Existing instances
To which instances is the code deployed to in the โRolling with additional batchโ deployment method?
New and existing instances
To which instances is the code deployed to in the โImmutableโ deployment method?
New instances
To which instances is the code deployed to in the โBlue/Greenโ deployment method?
New instances
Which deployment method incur a DNS change?
Blue/Green
What is the impact of a failed deployment when using the โAll at onceโ deployment method?
Down time
What is the impact of a failed deployment when using the โRollingโ deployment method?
Single batch out of service, the rest have either successfully updated or have not yet started updating
What is the impact of a failed deployment when using the โRolling with additional batchโ deployment method?
Minimal if it is the first batch, otherwise it is similar to rolling
What is the impact of a failed deployment when using the โImmutableโ deployment method?
Minimal
What is the impact of a failed deployment when using the โBlue/Greenโ deployment method?
Minimal
What is the main drawback of the โRolling โฆโ deployment methods?
You have the application running in both versions for a little while
Which parameters set in the EB UI can be configured in EB extensions?
All the parameters
Where must EB extensions be in our code base?
In a .ebextensions/ directory at the root level of our source code
What is the file naming convention for EB extensions?
File names can be anything
File extension must be .config
In what format are EB extensions written?
JSON or YAML
How can you add resources to EB from your source code?
In EB extensions file
What happens to resources managed by .ebextensions/files.config if the env goes away?
They get deleted
What is the EB CLI?
A great way to generate and manage EB projects easily from our local computer
What are the most common EB CLI commands?
eb create eb status eb health eb events eb logs eb open eb deploy eb config eb terminate
What is the EB Deployment Mechanism? (Installation process)
Code is zipped
Zip file is uploaded to EC2 machines
Each EC2 machine resolves dependencies and install the software
How to accelerate the deployment in EB?
By packaging dependencies with the source code
What are the two things you need to do to get HTTPS with EB?
Load SSL certificate onto the LB either
from the EB Console or from the the code (in a .ebextensions/file.config)
Allow incoming port 443 (HTTPS port)
How can you provision an SSL Certificate?
By using ACM (AWS Certificate Manager) or CLI
How can you redirect HTTP to HTTPS with EB?
Configuring your instances OR by configuring the ALB with a rule
What do you have to make sure when redirrecting traffic from HTTP to HTTPS in EB?
Not redirecting health checks (so they keep giving 200 OK responses)
How many versions can EB store at most?
1000
How to make sure you donโt end up with 1000 versions and are not able to deploy new versions?
By setting a lifecycle policy for the EB application
What are the things EB lifecyle policies can be based upon?
Based on time (old versions are removed)
Based on space (when you have too many versions)
Can versions that are currently being used be deleted?
No
How can you keep more than a 1000 versions?
By choosing the option not to delete older versions but to store them in S3
What should you do if your EB app has tasks that are long to complete?
Offload these tasks to a dedicated worker environment
How can you define periodic tasks in EB?
In a worker environment, create a cron.yaml file
Should RDS DB be provisioned with Beanstalk?
For dev/test it could be good, but for prod not so much
How to migrate from RDS coupled in EB to standalone RDS?
Take an RDS snapshot
Enable deletion protection in RDS
Create a new environement without an RDS which points to the old RDS (which is still attached to the old environment)
Perform a Blue/Green deployment and swap new and old environments
Terminate the old environment (RDS is not deleted because of deletion protection)
Delete CloudFormation stack of the old EB environment