BEANSTALK Flashcards

1
Q

Beanstalk overview

A

EC2, ASG, ELB, RDS etc

Uses all these, can see as one view in the UI
Can have full control of configurations

Beanstalk is FREE

-Managed Service
Instance Config/OS handled by beanstalk
Deployment strategy is configurable but managed by beanstalk

Just application code is developer responsibility

THREE Architecture model
Single Instance deploy: development
ELB+ASG Good for production/ preproduction
WEB APPLICATION 
ASG only: Good for workers NONWEB APPS
Beanstalk supports:
Single Container docker
Multicontainer docker
Preconfig docker
java , php, python etc.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Beanstalk overview COMPONENTS
Application
Application version
Environment name

A
  1. Application- CODE
  2. Application version - Each deployment of code gets version
  3. Environment name - what name of deployment, TEST PROD ETC

Beanstalk can deploy but also rollback to previous APPLICATION VERSION.

ex:
Code is deployed onto environment name test, this deployment is version 1.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Beanstalk DEPLOYMENT MODES
Single Instance
vs
High Availability

A

Single instance:

ALL WITHIN ONE AZ::
DNS name maps to ELASTIC IP ADDRESS
Development
One EC2 instance
One ELP
One ASG
DB optional
=============================================
High Availability with Load Balancer: Production

ON TOP
ELB on top: DNS name routes to ELB DNS name

ELB maps to multiple AZ:
ASG spans multiple AZ also:

In Each AZ you have a EC2 instance inside a security group that is the WEB app server

These EC2 instances may talk to RDS on multiple AZ, may have master and standby on separate AZ, not all AZ need a RDS.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q
Beanstalk DEPLOYMENT MODES 
UPDATING : ALL at once 
speed 
downtime
good for?
cost?
A

(single environment)
Turn all of, then convert all to V2

FASTEST
Application has downtime
Good for quick interation versions in development
NO ADDITIONAL COST

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q
Beanstalk DEPLOYMENT MODES 
UPDATING : ROLLING
Speed
downtime
good for
cost?
capacity
A

(single environment)
Half capacity, instances will turn off half at a time, convert to v2 then start process with other side

fast LONG DEPLOYMENT
Runs below capacity based on bucket size
Can set BUCKET SIZE: number of Ec2 instances that are affected
Application is running BOTH versions simultaneously
NO ADDITIONAL COST

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q
Beanstalk DEPLOYMENT MODES 
UPDATING : ROLLING WITH ADDITIONAL BATCHES
Speed
downtime
good for
cost?
capacity
A
(single environment)
Run at capacity
Set a specific bucket size
Run both versions
HAS SMALL ADDITIONAL COST, additional buckets removed later
GOOD FOR PRODUCTION

Longer deployment

Add additional instances based on bucket size, after additional are running v2, then original buckets start processing based on bucket size.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q
Beanstalk DEPLOYMENT MODES 
UPDATING : IMMUTABLE
Speed
downtime
good for
cost?
capacity
A

(single environment)
INSTANCES FROM NEW TEMP ASG
New auto scaling group costs more

Most cost
Fastest Rollback for contingency
Great choice for prod for additional cost
full capacity plus more
no downtime

Replicate to new ASG

  1. Launch one, validate that this version works
  2. If working then launches rest

Merge ASG, Temporary ASG will start moving instances into NEW ASG. If failure, then need to terminate temporary ASG

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Beanstalk DEPLOYMENT MODES

BLUE GREEN

A

(MULTIPLE ENVIROMENT)
Zero downtime
for testing

Deploy a new stage environment with its own version
ZERO downtime.

Use Route 52 to start routing traffic percentages from old to new over time
Canary, weighted etc

When ready, SWAP URL to make it PROD. This is a method, but not embedded into beanstalk. MANUAL OPERATION.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Elastic Beanstalk CLI “EB CLI”

A

Allows automation of development pipeline
EB CLI, working with EB from cli is much easier.

Commands like
EB create
status
health
events
logs
open
deploy
config
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Elastic Beanstalk Deployment process

A
  1. Describe Dependencies
    Requirements.txt python
    package.json Node.js
  2. A. CONSOLE: upload file into beanstalk, a new app version will be created, Now can be deployed.
  3. B. CLI: Create new app version using CLI (uploads ZIP) then deploy

ZIP when uploaded to Beanstalk gets uploaded to S3, Beanstalk refers to S3 bundle

Beanstalk will deploy zip on each Ec2, resolve dependencies and START application.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Elastic Beanstalk Extensions

A

Zip file containing code must be deployed to Beanstalk, this zip file can contain parameters that are normally set in UI to be configured in code using EBEXTENSIONS

configuration files must be Located in .ebextensions/ directory of ROOT SOURCE CODE
YAML / JSON format, (name must end with .config—>example.config)

*CAN MODIFY DEFAULT OPTIONS: modify settings in Option_settings file

EBextensions can add resources such as RDS , elasticache, DynamoDB etc.

ALL RESOURCES MADE IN THIS MANNER WILL BE DELETED IF BEANSTALK DEPLOYMENT IS DELETED.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Beanstalk and Cloudformation

A

Beanstalk relies on Cloudformation, it uses it as a basis for operations.

using Cloudformation resources in .EBEXTENSIONS, will allow you to provision anything you like , like cloudformation normally would do

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Beanstalk Cloning

A

Clone existing into new with exact same config
GOOD TO DEPLOY A TEST VERSION OF AN APP

All resources and config are preserved.
Load balancer and config
RDS database type (not the RDS data though)
environment variables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Beanstalk and Migration: Load balancer

after creating elastic beanstalk environment you cannot change the ELASTIC LOAD BALANCER TYPE

A

after creating elastic beanstalk environment you cannot change the ELASTIC LOAD BALANCER TYPE

  1. Create a new environment with a cloned config, change the ELB
  2. Deploy application onto NEW environment
  3. CNAME swap or Route 53 update to shift traffic
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Beanstalk and Migration: RDS

A

RDS that is launched with Beanstalk will be taken offline if Beanstalk goes offline:

Need to Decouple: Separate RDS database and provide EB with connection string.

How to do this through an EB created RDS

  1. Create snapshot of RDS database
  2. Go to RDS console and PROTECT DATABASE FROM DELETION*
  3. Create a new EB environment without RDS, use environment variable to connect to old RDS
  4. Cname swap/ route 53 change and confirm if its working

Terminate Old environment, RDS will not be terminated due to RDS protection, You will need to delete the cloud formation stack manually because termination will fail.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly