Elastic Beanstalk Flashcards

1
Q

What is Elastic Beanstalk?

A

Elastic beanstalk is a developer centric view of deploying an app on AWS. Managed service for handling provisioning of AWS components.

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

What is the difference between the Web Server Tier and the Worker Tier in Elastic Beanstalk?

A

Web server tier is a standard web app environment (ELB, auto scaling group, EC2 instances). A worker tier is for processing queues using SQS, auto scaling group and EC2 instances.

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

What are the two main deployment modes with Elastic Beanstalk?

A

Single instance (good for development) has an elastic ip. High availability with load balancer (good for prod).

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

In elastic beanstalk what are the 6 deployment options for updates?

A

All at once (deploy all in one go). Rolling. Rolling with additional batches. Immutable (new auto scaling group). Blue-Green. Traffic splitting (canary testing).

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

What happens during an “all at once” elastic beanstalk deployment?

A

All application instances are stopped, new version deployed and all app instances starts. Very fast, but has downtime, no additional cost.

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

What happens during a “rolling” elastic beanstalk deployment?

A

A specified number of app instances (called the bucket) are stopped and updated. After the first bucket the next bucket / set of instances are updated. Multiple versions running during deployment, no additional cost.

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

What happens during a “rolling with additional batches” elastic beanstalk deployment?

A

Similar to rolling but the number of running instances will surge. Small additional cost, additional batch is removed at the end. This ensures that there are always the required number of instances running during the deployment. Good for prod.

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

What happens during an “immutable” elastic beanstalk deployment?

A

New version of the app is deployed onto new EC2 instances on a temporary auto scaling group. Zero downtime, double the cost, but has very quick rollback. One initial instance created, once healthy all new instances spun up. Then they are moved into the auto scaling group, and old versions terminated.

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

What is the “blue green” elastic beanstalk concept?

A

Not a direct feature of elastic beanstalk, you create a new environment and deploy the new version there. Then use something like route53 to redirect some traffic to test using a weighted policy. Then using beanstalk “swap urls” when ready.

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

What is the “traffic splitting” elastic beanstalk deployment?

A

Used for canary testing. The new version is deployed to a temporary auto scaling group (with the same capacity). A % of traffic sent to the temporary ASG (new version) using the ALB. Deployment health is monitored. If failures automatic and very quick rollback. No downtime. When ready new instances migrated to the original ASG.

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

What is the beanstalk lifecycle policy?

A

Defines how to phase out old app versions, beanstalk can store up to 1000 app versions. Policy can be based on time or based on space. Versions currently used won’t be deleted.

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

What are elastic beanstalk extensions?

A

Files containing parameters for EB. Must be in the .ebextensions/ directory in the root of source code. Must be in YAML or JSON. File extension must end with *.config. Able to modify some default settings. Ability to add resources such as RDS, ElastiCache etc

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

What is cloud formation?

A

Used to provision AWS services, elastic beanstalk uses it to perform a lot of its operations.

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

When cloning an elastic beanstalk environment would the data within a RDS database be cloned?

A

No

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

After creating an elastic beanstalk environment can you change the type of the ELB?

A

No, you can only change the configuration

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

How would you perform a elastic beanstalk migration (for example changing the type of the ELB from classic to app load balancer)?

A

Create a new EB environment with the same config except the LB. You cannot use the clone. Deploy the app to the environment. Perform a CNAME swap or route53 update.

17
Q

Should you use RDS databases within a prod elastic beanstalk environment?

A

Generally speaking no, it is best to separately create them. This is because the database lifecycle is tied to the beanstalk environment lifecycle.

18
Q

How would you de-couple a RDS database from an EB environment?

A

Create a snapshot of the RDS. In the RDS console protect the database from deletion. Create a new EB environment without the RDS, instead point the app to the existing RDS. Perform DNS update. Terminate the old EB environment (RDS won’t be deleted). Delete the cloud formation stack (stuck in deleted_failed state).

19
Q

A company hosting their website on AWS Elastic Beanstalk. They want a methodology to continuously release new application versions with the ability to roll back very quickly in case if there’re any issues. Also, the application must be running at full capacity while releasing new versions. Which Elastic Beanstalk deployment option do you recommend? - All at once. Rolling. Rolling with additional batches. Immutable.

A

Immutable.

20
Q

Your deployments on Elastic Beanstalk have been painfully slow. After checking the logs, you realize that this is due to the fact that your application dependencies are resolved on each instance each time you deploy. What can you do to speed up the deployment process with minimal impact?

A

Resolve the dependencies beforehand and package them in the zip file uploaded to elastic beanstalk.

21
Q

For an elastic beanstalk extension file what should its extension be and where should it be placed?

A

Must have a .config extension and must be placed in the .ebextensions folder at the root of the code zip

22
Q

In cloud formation how would you use a resource that isn’t supported yet?

A

Use cloud formation custom resources

23
Q

By default what happens when a cloud formation stack creation fails?

A

Everything rolls back and gets deleted

24
Q

By default what happens when an update to a cloud formation stack fails?

A

The updates roll back to the last previously known working state

25
Q

Explain how the Service Role in cloud formation works

A

Define a role for cloud formation with permissions required to create a stack. Then a user can create a stack via a template provided they have the cloud formation permissions and the iam:PassRole permission, without needing permission to access the resources the cloud formation template will create.

26
Q

Explain the purpose of capabilities within cloud formation

A

Capabilities are used to confirm creation of certain resources, for example IAM roles.

27
Q

What are the three different deletion policies that can be applied to cloud formation resources?

A

Delete - remove resources when stack is deleted (default). Retain - don’t delete. Snapshot - create a snapshot before deletion (only for some resource types for example RDS, ElastiCache, EBS volumes).

28
Q

What is a cloud formation stack policy?

A

Defines what can and can’t be updated within a stack, defined using a json file

29
Q

What can custom cloud formation resources be used for?

A

Define resources not yet supported by cloud formation. Custom provisioning of resources outside of AWS. Custom scripts / Lambda functions e.g. delete contents of a S3 bucket before deleting the bucket

30
Q

What can a custom cloud formation resource be backed by?

A

A lambda function or a SNS topic

31
Q

What are cloud formation stack sets?

A

A collection of CF stacks, can be across multiple accounts and regions, lets you create/update multiple stacks in one operation. Can be applied into all accounts within an AWS organisation.

32
Q

An Administrator created an AWS CloudFormation template for the first time. The stack failed with a status of ROLLBACK_COMPLETE. The Administrator identified and resolved the template issue that caused the failure. How should the Administrator continue with the stack deployment?

A

Delete the stack and create a new one.

33
Q

Exported cloud formation output names must be unique within the region, true or false?

A

True