Beanstalk Flashcards

1
Q

What is Beanstalk?

A

A developer centric view of deploying an application on AWS that uses ec2, asg, alb

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

What is the responsibility of the developer for beanstalk?

A

Just the application code

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

What are the three architecture models:

A

Single instance deployment: good for dev, LB+ ASG: freat for production or pre-production web applications, ASG only: great for non-web apps in production

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

Model for Elastic Beanstalk

A

Create application -> create environment -> upload version -> release to environment

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

Beanstalk deployment options for updates

A

All at once (deploy all in one go) - fast, but instances aren’t available to serve traffic for a bit (downtime).
Rolling: update a few instances at a time(bucket), and then move onto the next bucket once the first bucket is healthy
Rolling w/ additional batches: like rolling, but spins up new instances to move the batch (so that the old application is still available).
Immutable: spins up new instances in a new ASG, deploys versions to these instances, and then swaps all the instances when everything is healthy

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

Blue/Green deployment

A

Zero downtime, original environment is blue, new environment green can be validated independently and rolled back. Weighted policy to direct to blue and green.

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

Beanstalk deployment process

A

Describe dependencies, package code as zip, upload zip file and then deploy. Beanstalk will then deploy the zip on each ec2 instance, resolve dependencies and start the application

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

Beanstalk lifecycle policy

A

Beanstalk can store at most 1000 app versions. If you don’t remove old versions you won’t be able to deploy anymore.

  • Use lifecycle policy based on time or space (too many versions).
  • You have the option not to delete the source bundle in S3 to prevent data loss
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How to add Beanstalk extensions

A

.config file within .ebxentions folder, yaml/JSON format, allows you to add resources such as RDS, Elasticache, Dynamodb.

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

If the Beanstalk environment goes away, what gets deleted

A

resources managed by .ebextentions.

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

After creating an environment, can you change the ELB type?

A

No, you need to create a new environment (cannot clone it), and then deploy your application on the new environment and perform a CNAME swap of the Route 53 update.

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

How do you provision RDS with beanstalk?

A

It is not great for production since the DB lifecycle is tied to the beanstalk environment lifecycle, so the best way is to create a snapshot of rds db, and point your app (by creating a new environment) to the existing RDS), then perform a CNAM swap, terminate old environment, and delete cloudformation swap

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

How to run a single docker on beanstalk

A

Provide a dockerfile or dockerrun.aws.json. Do not use ECS.

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

How to run a multi docker container

A

Requires a config dockerrunaws.json at the route of the source code.

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

How to run beanstalk and HTTPS

A

Load the SSL certificate on the load balancer, or from alb.config or . ebextensions. Must also configure security group rule to allow incoming port 443.

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

How to redirect beanstalk http to https:

A

configure your instances to redirect or configure ALB with a rule, make sure health checks are not redirected.

17
Q

Web server vs. worker env

A

If your app performs tasks that are long to complete, offload these tasks to a dedicated worker environment. (processing a video, generating a zip file)

18
Q

What happens if your applications language is incompatible with beanstalk and doesn’t use docker

A

Use a custom platform, define an AMI using platform.yaml file. Build that platform using Pooter software(open source tools to create AMI)