Section 17: AWS Elastic Beanstalk Flashcards

1
Q

T/F

This is the AWS glossary definition of elastic beanstalk: “ A logical collection of components, including environments, versions, and environment configurations. An application is conceptually similar to a folder.”

A

True

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

T/F

Why does AWS say you should use Elastic Beanstalk?

A

Elastic Beanstalk is a service for deploying and scaling web applications and services. Upload your code and Elastic Beanstalk automatically handles the deployment—from capacity provisioning, load balancing, and auto scaling to application health monitoring.

https://aws.amazon.com/elasticbeanstalk/?gclid=Cj0KCQiAy9msBhD0ARIsANbk0A8uXIbD3ikLDdtBenk6sClW-TOLPLGb9daCWkNmLRru_2cPdd4UKdwaApYQEALw_wcB&trk=b1c3dd7d-1b94-4b82-99e3-c1505e3a55fb&sc_channel=ps&ef_id=Cj0KCQiAy9msBhD0ARIsANbk0A8uXIbD3ikLDdtBenk6sClW-TOLPLGb9daCWkNmLRru_2cPdd4UKdwaApYQEALw_wcB:G:s&s_kwcid=AL!4422!3!651737511569!e!!g!!elastic%20beanstalk!19845796021!146736269029

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

elastic beanstalk automatically handles the what (number of things) so developers can do what?

A
  1. elastic beanstalk automatically handles the capacity provisioning, load balancing, scaling, application health monitoring, instance configuration etc
  2. so developers can focus on just the application code
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

When using elastic beanstalk, does the developer still have full control over the configuration?

A

yes

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

Does beanstalk cost money?

A

No, but you pay for the underlying instances (any ec2s, albs, elbs, rds’s etc)

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

What aws services does beanstalk use? (Languages and four specific services)

A

” Elastic Beanstalk is ideal if you have a PHP, Java, Python, Ruby, Node.js, .NET, Go, or Docker web application. Elastic Beanstalk uses core AWS services such as Amazon Elastic Compute Cloud (EC2), Amazon Elastic Container Service (ECS), AWS Auto Scaling, and Elastic Load Balancing (ELB) to easily support applications that need to scale to serve millions of users.”

https://aws.amazon.com/elasticbeanstalk/details/#:~:text=js%2C%20.,to%20serve%20millions%20of%20users.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q
  1. name some of the supported platforms for elastic beanstalk.
  2. What happens if the platform you want is not supported?
A
  1. full list: Go, Java SE, Java with Tomcat, .NET Core on Linux, .NET in WIndows, Node.js, PHP, Python, Ruby, Packer Builder, Single Container Docker, Multi Container Docker, Preconfigured Docker.
  2. If the platform you want is not supported yiou can write your own custom platform.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is an environment tier in elastic beanstalk? What are the two options?

A

“Environment tiers designate the type of application that the environment runs, and determines what resources Elastic Beanstalk provisions to support it.” The two options are web server environment tier (for serving http requests) and worker environment tier (for pulling tasks from an Amazon Simple Queue Service queue).

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

If you have an application that serves HTTP requests, which elastic beanstalk environment tier should you use?

A

You should use a web server environment tier.

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

If you have a backend environment (i think app might make more sense to me) that pulls tasks from an Amazon Simple Queue Service (Amazon SQS) queue uses what kind of Elastic Beanstalk environment tier?

A

Worker environment tier

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

How many deployment options are there for beanstalk, and what are they? (just names, we’ll cover definitions later)

A

6 options: all at once, rolling, rolling with additional batches, immutable, blue green, traffic splitting

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

What is beanstalk deployment option “all at once”. Does it incur an additional cost?

A

Deploy all instances in one go. It’s the fastest of the dpeloyment options, but the instances aren’t available to serve traffic for a bit (guess it’s still the fastest?). no a

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q
  1. What is beanstalk deployment option “rolling”. Describe it in terms of what happens if you have four buckets of application version 1 and want to implement application version 2.
  2. Does it incur an additional cost?
  3. Is it a slow or fast overall deployment process?
A

update a few instances at a time (bucket, whatever that means) and then move onto the next bucket once the first bucket is healthy.

  1. If you have four buckets of version 1, two might get removed. after that two buckets of version 2 get added. Then the final two buckets of version one get removed, then the final two buckets of version two get added. Now you have four buckets of version two. This means that for a time, your app is running below capacity. Then after that, for ahile your application is running both versions simultaneously. You can choose the bucket size
  2. It incurs no additional cost.
  3. Slow.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q
  1. What is beanstalk deployment option “rolling with additional batches”. Describe what happens if you have four applications of version 1 running and you want them to become application version 2s.
  2. Does it incur an additional cost?
  3. Slower or longer deployment?
A
  1. like rolling, but it spins up new instances to move the batch (so that the old app is still available).
    Application is always running at capacity. If you have four v1s, two v2s get added. When they’re ready, two of the v1s get removed. Then after that, two more v2s get added. Then when those are ready, the last two v1s get removed. Now you have no v1s and four v2s. You can set the bucket size. so I suppose you could have determined how many buckets to add/remove each time.
  2. incurs small additional cost
  3. longer deployment
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q
  1. What is beanstalk deployment option “immutable” . How does it work if you have four v1s and you want four application version 2s.
  2. Does it incur an additional cost?
  3. Slower or longer deployment?
A
  1. spins up new instances in a new, temporary ASG. Then deploys the v2s in the new ASG.Then when the new instances are ready, the new instances get moved to the first ASG. Then the v1 instances are terminated.
  2. high cost, double capacity
  3. longest deployment
  4. great for prod, since there is zero downtime and quick rollback in case of failures.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q
  1. what is beanstalk option “blue green”. What happens if you have four application v1s and you want four application v2s?
  2. Does it incur an additional cost?
A

think of your v1 environment as environment blue. Then an environment green gets created for v2. When the v2 instances are ready, route 53 can be setup using weighted policies (to do something like 10% of traffic to the green v2 instance having environment). Then using beanstalk you swap URLS when done with the environment test. No DNS change.

create a new environment and switch over when ready

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q
  1. What is beanstalk environment “traffic splitting”?
  2. Is there application downtime?
  3. Does it incur an additional cost?
A
  1. Traffic-splitting deployments allow you to perform canary testing. You direct some incoming client traffic to your new application version to verify the application’s health before committing to the new version and directing all traffic to it.
  2. there is no application downtime.
  3. It’s not mentioned.
  4. Long version: During a traffic-splitting deployment, Elastic Beanstalk creates a new set of instances in a separate temporary Auto Scaling group. Elastic Beanstalk then instructs the load balancer to direct a certain percentage of your environment’s incoming traffic to the new instances. Then, for a configured amount of time, Elastic Beanstalk tracks the health of the new set of instances. If all is well, Elastic Beanstalk shifts remaining traffic to the new instances and attaches them to the environment’s original Auto Scaling group, replacing the old instances. Then Elastic Beanstalk cleans up—terminates the old instances and removes the temporary Auto Scaling group.

Note

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q
  1. Which of the deployment options was mentioned as best for prod?
  2. Which was mentioned as best for dev?
  3. Which is the only one that requires swapping a url?
A
  1. for prod: immutable.
  2. for dev: all at once.
  3. blue/green
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Beanstalk cli basic commands are:

A
  1. eb create
  2. eb status
  3. eb health
  4. eb events
  5. eb logs
  6. eb open
  7. eb deploy
  8. eb config
  9. eb terminate

The Scold c.
it’s helpful for automated deploymennt pipelines!

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

beanstalk deployment process:

A
  1. describe dependencies (requirements.txt for python, package.json for Node.js etc)
  2. package code as zip, and describe dependencies (python requirements.txt, node.js package.json yes I know it just said that)
  3. console: upload zip file (creates new app version) and then deploy. alternatively, use the CLI to create the new app version (uploads zip) and then deploy
  4. elastic beanstalk will 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
21
Q

elastic beanstalk lifecycle policy.
1. is there a limit on how many application versions can be stored for an app?
2. what is the limit?
3. what happens if you reach the limit?
4. how do you address this?
5. will versions currently in use be deleted?
6. do you have the option to not delete the source bundle in s3, thereby ensuring no data loss?

A
  1. yes.
  2. elastic beanstalk can store at most 1000 app versions.
  3. if you dont’ remove old versions, you won’t be able to deploy anymore.
  4. To phase out old app versions, use a lifecycle policy. You can base this on time (oldest versions removed) or space (when you have too many versions)
  5. no
  6. By default, Elastic Beanstalk leaves the application version’s source bundle in Amazon S3 to prevent loss of data. You can delete the source bundle to save space.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

You can use elastic beanstalk extensions to customize your elastic beanstalk environment.
1. What is the name of the directory, and where is the directory located, that helps with this
2. can you set all the parameters in the UI by using these code files?
3. when do we use these?
4. what is needed to use elastic beanstalk extensions?
5. what happens if the environment goes away?

A
  1. .ebextensions/ it’s located in the root of the source code
  2. yes
  3. when you’re going to be sending up a zip fie containing code to elastic beanstalk anyway? real fuzzy on this one
  4. you need files in the .ebextensions directory; yaml or json format; .config extensions (for example, logging.config); ability to modify some default settings using option_settings; ability to add resources such as RDS, ElastiCache, DynamoDB etc
  5. resources managed by .ebextensions get deleted if the environment goes away
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

what does elastic beanstalk rely on under the hood

A

cloudFormation

24
Q

does elastic beanstalk love cloudformation?

A

Yes. I know, a silly question, but there was a heart in the slides to get this point across and I’m tired.

25
Q

Can you define CloudFormation resources in your .ebextensions files to provision ElasticCache or an S3 bucket or anything you want?

A

Yes. Those are excellent use cases. Id maybe look more into it later and add more cards.

26
Q

Can you clone an elastic beanstalk environment to create another environment with the same configuration as the first?

A

yes

27
Q

Is elastic beanstalk environment cloning useful for deploying a test version of your application?

A

Yes

28
Q

Can you change an elastic beanstalk environments settings if it was made from a clone of another elastic beanstalk environment?

A

Yep yep yep

29
Q

when you clone an elastic beanstalk environment, are all resources and configurations preserved (are new identical ones made) in the cloned version? What is not carried over?

A

Yes. includes load balancer type and configuration, RDS database type (though data is not preserved), environment variables. What is not carried over is any data in the RDS database.

30
Q

Can you change the elastic load balancer type after creating an elastic beanstalk environment?

A

No

31
Q

How do you migrate an elastic beanstalk environment so it uses a new load balncer type?

A
  1. create a new environment with the same configuration (except for the load balancer, which you can’t clone. I actually suspect the word should have been shouldn’t. that’s probably what it is implied in the transcript)
  2. deploy your app onto the new environment. at some point around here, add the new load balancer to the new environment.
  3. perform a CNAME swap or Route 53 update
32
Q

RDS with Elastic Beanstalk.
Can RDS be provisioned for Beanstalk. Which deployment environments (if any) is this best for?

A

Yes. dev/test

33
Q

RDS with Elastic Beanstalk.
Is this good for prod?

A

No, as the database lifecycle is tied to the beanstalk environment lifecycle.

34
Q

What is the best way to use RDS with beanstalk? (I think there’s another question about how you shouldn’t use RDS with elastic beanstalk in prod, look into that and make sure these aren’t disagreeing with each other)

A

Separately (outside of beanstalk) create an RDS database. Then provide your elastic beanstalk instance/application wahtever with the connection string.

35
Q

Say you want to move to your existing elastic beanstalk environment to a new elastic beanstalk environment and your existing environment has a connection to an RDS DB. Should you creat ea snapshot of your RDS DB as a safegaurd?

A

yes

36
Q

Say you want to move to your existing elastic beanstalk environment to a new elastic beanstalk environment and your existing environment has a connection to an RDS DB. after creating your rds snapshot, should you go to the RDS console and protect the RDS database from deletion?

A

Yes

37
Q

Say you want to move to your existing elastic beanstalk environment to a new elastic beanstalk environment and your existing environment has a connection to an RDS DB. after creating your rds snapshot, and then going to the RDS console to protect the RDS database from deletion, what is the next step?

A

create a new elastic beanstalk environment without RDS< piont your application to the existing RDS

38
Q

Say you want to move to your existing elastic beanstalk environment to a new elastic beanstalk environment and your existing environment has a connection to an RDS DB. after creating your rds snapshot, and then going to the RDS console to protect the RDS database from deletion, and then creating a new elastic beanstalk environment without rds and pointing your application to the existing rds, what are the next two steps?

A

perform a cname swap (blue green) or route 53 update, confirm working. Then terminate your old environment. rds won’t be deleted.

39
Q

Say you want to move to your existing elastic beanstalk environment to a new elastic beanstalk environment and your existing environment has a connection to an RDS DB. How do you go about this?

A
  1. create a snapshot of RDS DB (as a safegaurd)
  2. go to the rds console and protect the rds database from deletion
  3. create a new elastic beanstalk environment, without rds, point your application to the existing rds
  4. perform a CNAME swap (blue green) or Route 53 update, confirm it’s working
  5. terminate the old environment (RDS won’t be deleted, I presume because your new environment is connected to it)
40
Q
A

Correct answer A: “The question mentions that you’re still in the development stage and you want to reduce costs. Single Instance Mode will create one EC2 instance and one Elastic IP.

incorrect B note: This will create one or more EC2 instances and one Elastic Load Balancer (this costs more).

41
Q
A

Correct answer B. no notes.

42
Q
A

correct answer is B. No answer choices have notes.

43
Q
A

Correct answer is B. “Environments in Elastic Beanstalk can be named freely.”

44
Q
A

Correct answer is A. No answer choices have notes.

45
Q
A

Correct answer is D. “In this mode, a full set of new instances running the new version of the application in a separate Auto Scaling Group is launched. To roll back quickly, this mode terminates the ASG holding the new application version, while the current one is untouched and already running at full capacity.
“.

No incorrect answer choices have notes.

46
Q
A

B is the correct answer. no answer choices have notes. You need to check this again.

47
Q
A

C is the correct answer. No choices have notes.

48
Q
A

D is the correct choice. No choices have notes.

49
Q
A

A is the correct choice. No choices have notes.

50
Q
A

B is the correct answer. No ansewr choices have notes.

51
Q
A

Correct answer choice is C. It didn’t have a note. I only checked one of the incorrect answers, but that one didn’t have a note.

52
Q
A

B is the correct answer. No choices have notes.

53
Q
A

D is the correct answer. Note is https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features-managing-env-tiers.html

No incorrect choices have notes.

54
Q
A

B is the correct answer choice. No choices have notes.

55
Q
A

Correct choice is A. No choices have notes.

56
Q
A

C is the correct answer choice. No choices have notes.

57
Q

T/F: Elastic Beanstalk uses Amazon Elastic Container Service (Amazon ECS) to coordinate container deployments to ECS managed Docker environments. (elastic beanstalk can use other types of platforms too, but this question is not about those).

A

True