Elastic Beanstalk Flashcards Preview

AWS Developer Associate > Elastic Beanstalk > Flashcards

Flashcards in Elastic Beanstalk Deck (38)
Loading flashcards...
1
Q

For a blue/green deployment type in Beanstalk which sort of DNS record is changed when you swap a url to point to a different application version?

A

CNAME.

2
Q

You have performed a URL swap for a blue/green beanstalk deployment. When you hit the URL for the ‘blue’ site though, nothing seems to have changed. Why?

A

CNAME record changes occur at the R53 level. If DNS records are cached, the change may not be visible until the TTL expires.

3
Q

I would like to customize the runtime of Elastic Beanstalk and include some of my company wide security software. I should

  • Use EC2 userdata
  • Use Docker
  • Create a custom platform
A

Create a custom platform

4
Q

Why can you not use Lambda as a resource for Beanstalk to provision a web environment?

A

Because lambda is an event driven severless platform that runs code in response to events and automatically manages the resources required for running that code.

5
Q

Can Beanstalk deploy application versions to multiple environments?

A

Yes

6
Q

You have created a test environment in Elastic Beanstalk and as part of that environment, you have created an RDS database. How can you make sure the database can be explored after the environment is destroyed?

  • Take a snapshot of the RDS database
  • Use selective deletion in Beanstalk
  • Change the elastic Beanstalk environment variables
A

Take a snapshot of the RDS database

7
Q

We have a development environment set up in Beanstalk, and a fast cadence of code releases. We can also handle a little bit of downtime as code is being deployed. Which Deployment model is best in this situation?

A

All At Once. This is the fastest deployment mode, but it comes at the cost of downtime as all the instances are unavailable as the deployment takes place

8
Q

When you remove an application version via a lifecycle rule, do you have the option to persist the source bundle on S3

A

Yes

9
Q

When and why would you use Packer?

A

You would use packer when creating your own custom Beanstalk platform. It is an open source AMI creation tool.

10
Q

There are 3 architecture models for Beanstalk. What are they?

A

Single instance
ALB+ASG
ASG only (for worker processes)

11
Q

What two are the two configuration options available for a Beanstalk Life cycle policy?

A
  1. Time Based: Beanstalk can be configured to remove versions when they hit a specified age.
  2. Space Based: Beanstalk can be configured to remove old versions of an application when a specified number of versions is hit
12
Q

My deployments on Elastic Beanstalk have been painfully slow, and after looking at the logs, I realize this is due to the fact that my dependencies are resolved on each EC2 machine at deployment time. How can I speed up my deployment with the minimal impact?

  • Place the dependencies in S3
  • Remove the dependencies from your code
  • Resolve the dependencies and package them in the application zip which gets uploaded to Beanstalk
A

Resolve the dependencies and package them in the application zip which gets uploaded to Beanstalk

13
Q

Where must EB Extension config files be located?

A

in the /.ebextensions directory in you application zip files root directory.

14
Q

When running an immutable deployment, what is the first step that Beanstalk takes when deploying new application ?

A

Beanstalk will deploy the application to one instance and execute health checks against that instance. If these pass, it will continue the deployment including creating the ASG.

15
Q

We have a lifecycle policy set up to remove versions of an application when they are over 200 days old. What will happen with this policy if we have a currently used version of the application that is over 200 days old?

A

Nothing. Currently used versions of the application are unaffected by Beanstalk.

16
Q

When creating ebextensions files - what must the filename end in?

A

.config

17
Q

You would like your Elastic Beanstalk environment to expose an HTTPS endpoint instead of an HTTP endpoint in order to get in-flight encryption between your clients and your web servers. What must be done to setup HTTPS on Beanstalk?

  • Use a seperate CF template and load the SSL cert into the load balancer
  • create an .ebextension/elb.config file to configure the LB
  • Open port 443 for the Security group
  • Enable Health checks
A

-create an .ebextension/elb.config file to configure the LB

18
Q

How many versions of an application can you have in Beanstalk and what are the implications of this number when it comes to deployments?

A
  1. The implication is that if you hit this limit, you will not be able to deploy new versions.
19
Q

What service does Elastic Beanstalk use under the hood?

A

CloudFormation

20
Q

If you provision a single container docker application via Beanstalk, does this provision an ECS cluster, or provision an EC2 instance with docker?

A

A single container docker application will be run on an Ec2 instance with docker

21
Q

By default, does health monitoring in beanstalk publish metrics to cloudwatch?

A

No.

22
Q

We have a Beanstalk environment set up for our production application and we need to determine the best strategy for updates. The caveat is that we are NOT able to reduce our capacity during the update, although we are ok with having both versions of the application running concurrently and with a long update.

A

In this case, we would use a rolling update with batches. This ensures that we are never below capacity during the update as new instances based on the bucket size will be spooled up, added to the deployment and then old instances will be taken down. I.e. if we have 4 instances running v1, and a bucket size of 2, then for a time we will have 4 v1+ 2v2 = 6 instances, then 2v1 + 4v2 = 6 and finally4 v2

23
Q

There are four types of DEPLOYMENTS (not architectures) for elastic Beanstalk. What are they (5)?

A
All At Once
Rolling
Rolling with Batches
Immutable
Blue/Green
24
Q

what is the purpose of elastic beanstalk extensions

A

EBExtensions allow you to define cloud formation resources to provision during EB stack creation via a JSON or YAML config file. They give you access to resources that are not provisionable through the UI - such as Elasticache.

25
Q

We have a Beanstalk environment set up for our production application and we need to determine the best strategy for updates. We are not to worried about loosing some capacity during the update but we can’t have downtime. We are OK with having both versions of the application running concurrently and with a long update. The caveat is that we are very tightly strapped for cash at the moment and don’t want to pay for additional capacity during the update process. What strategy would we use?

A

In this case, we would use a rolling update. During this we will loose some capacity as buckets of instances are unavailable for the deployment. We will have some time where we have both code versions running at the same time. There is however no cost for a rolling update.

26
Q

What is the role of a life cycle policy in Beanstalk?

A

A life cycle policy is used to remove old versions of an application within Beanstalk

27
Q

Is there a cost for using Beanstalk?

A

No, but there is a cost for the resources created by it

28
Q

You are looking to perform a set of repetitive and scheduled tasks asynchronously. Which Elastic Beanstalk environment should you setup?

  • Set up a web server environment using ebextensions
  • Setup a web server env using cron.yaml
  • Set up a worker environment using ebextensions
  • Set up a worker environment using cron.yaml
A

Set up a worker environment using cron.yaml

29
Q

For rolling and rolling with batches, can you specify a fixed number of machines to roll to, a percentage, or both?

A

Both

30
Q

There are two ways we can get Elastic Beanstalk to provision a single container docker environment. What are they?

A
  1. Provide EB with a docker file

2. Provide a dockerrun.aws.json file which describes where a pre built docker image is.

31
Q

What internal (2) and external (1) AWS services can Beanstalk use as a source repository? Where does beanstalk store its app version packages?

A

Git
CodeCommit
S3

Appversion packages are stored on S3

32
Q

In Beanstalk, what is the difference between an environment and an environment tier?

A

Environment: Separate version of the app and the AWS cloud components required to support the version. One environment can only have one version of the app, but multiple environments can have the same version.

Environment Tier: Resources required to provision the environment defined by the expected number of requests and resource utilisation. Each will have its own config which can be customised.

33
Q
What do the following Elastic Beanstalk CLI commands do?
aws eb init (careful)
aws eb create
aws eb deploy
aws eb clone
aws eb codesource (careful)
A

init: sets default values for your apps
create: creates a new environment AND deploys the app
deploy: deploys to an existing environment
clone: clones environment to a new environment
codesource: configures code commit repo or disables codecommit integration.

34
Q

I have an elastic beanstalk environment which relies on an RDS database to provide its backend datastore functionality. When selecting a deployment type, which of the 5 deployment strategies would not be a good candidate, why and what would need to be done if this strategy was used?

A

Blue/Green is not suitable for deploying with an RDS instance. As traffic is swapped from the blue to the green deployment data is not automatically transferred to RDS so we will loose data. We would need to take snapshots and backups to mitigate this.

35
Q

In an Elastic Beanstalk immutable deployment how many instances need to pass a health check for the deployment to be successful. What happens to the deployments temp ASG if this is not the case?

A

All instances must pass. If they don’t, the ASG is terminated.

36
Q

Both an immutable deployment and a blue green deployment in beanstalk create a new environment. What is the key difference between the two? Which allows for rollback?

A

In an immutable deployment a new environment is created: deployment of application code by starting an entirely new set of servers with a new configuration or version of application code. Once healthchecks are done this is promoted to the primary environment and the temp asg is deleted: you have 1 version of the code.

For Blue/Green Once the new environment is up and passed all tests, traffic is shifted to this new deployment. Crucially the old environment, that is, the “blue” environment, is kept idle in case a rollback is needed.

37
Q

When executing an immutable deployment, does Elastic beanstalk provision all instances into the temp ASG at once or not?

A

No. First EB will provision a single instance with the new configuration in the new group. If that passes health checks it will continue to provision the rest

38
Q

By default, are Beanstalk metrics published to cloudwatch?

A

No.