AWS CodeDeploy Flashcards

1
Q

What is Code Deploy ?

A

CodeDeploy is a deployment service that automates application deployments to Amazon EC2 instances, on-premises instances, serverless Lambda functions, or Amazon ECS services.

You can deploy a nearly unlimited variety of application content, including:

  • Serverless AWS Lambda functions.
  • Web and configuration files.
  • Executables.
  • Packages.
  • Scripts.
  • Multimedia files.

Integrates with various CI/CD tools including Jenkins, GitHub, Atlassian, AWS CodePipeline as well as config management tools like Ansible, Puppet and Chef.

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

What information does CodeDeploy Application contain ?

A

An AWS CodeDeploy application contains information about what to deploy and how to deploy it.

Need to choose the compute platform:

  • EC2/On-premises.
  • AWS Lambda.
  • Amazon ECS.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

EC2/On-Premises: - EC2/On-Premises:

A
  • Amazon EC2 cloud instances, on-premises servers, or both.
  • Deployments that use the EC2/On-Premises compute platform manage the way in which traffic is directed to instances by using an in-place or blue/green deployment type.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

CodeDeploy Application: AWS Lambda:

A
  • Used to deploy applications that consist of an updated version of a Lambda function.
  • You can manage the way in which traffic is shifted to the updated Lambda function versions during a deployment by choosing a canary, linear, or all-at-once configuration.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

CodeDeploy Application: Amazon ECS:

A

Used to deploy an Amazon ECS containerized application as a task set.

CodeDeploy performs a blue/green deployment by installing an updated version of the application as a new replacement task set.

CodeDeploy reroutes production traffic from the original application task set to the replacement task set.

The original task set is terminated after a successful deployment.

You can manage the way in which traffic is shifted to the updated task set during a deployment by choosing a canary, linear, or all-at-once configuration.

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

What is a Deployment Group ?

A

Each deployment group belongs to one application and specifies:

  • A deployment configuration – a set of deployment rules as well as success / failure conditions used during a deployment.
  • Notifications configuration for deployment events.
  • Amazon CloudWatch alarms to monitor a deployment.
  • Deployment rollback configuration.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the Deployment Types

A

CodeDeploy provides two deployment type options – in-place and blue/green.

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

In-place deployment Principles

A

The application on each instance in the deployment group is stopped, the latest application revision is installed, and the new version of the application is started and validated.

You can use a load balancer so that each instance is deregistered during its deployment and then restored to service after the deployment is complete.

Only deployments that use the EC2/On-Premises compute platform can use in-place deployments.

Exam tip: AWS Lambda and Amazon ECS deployments cannot use an in-place deployment type.

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

Blue/green on an EC2/On-Premises compute platform PRinciples

A

The instances in a deployment group (the original environment) are replaced by a different set of instances (the replacement environment) using these steps:

Instances are provisioned for the replacement environment.

The latest application revision is installed on the replacement instances.

An optional wait time occurs for activities such as application testing and system verification.

Instances in the replacement environment are registered with an Elastic Load Balancing load balancer, causing traffic to be rerouted to them.

Instances in the original environment are deregistered and can be terminated or kept running for other uses.

Note: If you use an EC2/On-Premises compute platform, be aware that blue/green deployments work with Amazon EC2 instances only.

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

Blue/green on an AWS Lambda compute platform Principles

A
  • Traffic is shifted from your current serverless environment to one with your updated Lambda function versions.
  • You can specify Lambda functions that perform validation tests and choose the way in which the traffic shifting occurs.
  • All AWS Lambda compute platform deployments are blue/green deployments.
  • For this reason, you do not need to specify a deployment type.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Blue/green on an Amazon ECS compute platform Principles

A
  • Traffic is shifted from the task set with the original version of an application in an Amazon ECS service to a replacement task set in the same service.
  • You can set the traffic shifting to linear or canary through the deployment configuration.
  • The protocol and port of a specified load balancer listener is used to reroute production traffic.
  • During a deployment, a test listener can be used to serve traffic to the replacement task set while validation tests are run.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

AppSpec File

A

The application specification file (AppSpec file) is a YAML-formatted, or JSON-formatted file used by CodeDeploy to manage a deployment.

The AppSpec file defines the deployment actions you want AWS CodeDeploy to execute.

The name of the AppSpec file for an EC2/On-Premises deployment must be appspec.yml.

The name of the AppSpec file for an Amazon ECS or AWS Lambda deployment must be appspec.yaml or appspec.yml.

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

AppSpec.yaml for AWS Lambda hooks ?

A

BeforeAllowTraffic – used to specify the tasks or functions you want to run before traffic is routed to the newly deployed Lambda function.

AfterAllowTraffic – used to specify the tasks or functions you want to run after the traffic has been routed to the newly deployed Lambda function.

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

How does In-place deployment (EC2 only) work ?

A

First, you create deployable content on your local development machine or similar environment, and then you add an application specification file (AppSpec file). The AppSpec file is unique to CodeDeploy. It defines the deployment actions you want CodeDeploy to execute. You bundle your deployable content and the AppSpec file into an archive file, and then upload it to an Amazon S3 bucket or a GitHub repository. This archive file is called an application revision (or simply a revision).

Next, you provide CodeDeploy with information about your deployment, such as which Amazon S3 bucket or GitHub repository to pull the revision from and to which set of Amazon EC2 instances to deploy its contents.

CodeDeploy calls a set of Amazon EC2 instances a deployment group. A deployment group contains individually tagged Amazon EC2 instances, Amazon EC2 instances in Amazon EC2 Auto Scaling groups, or both.
Each time you successfully upload a new application revision that you want to deploy to the deployment group, that bundle is set as the target revision for the deployment group.

In other words, the application revision that is currently targeted for deployment is the target revision. This is also the revision that is pulled for automatic deployments.

Next, the CodeDeploy agent on each instance polls CodeDeploy to determine what and when to pull from the specified Amazon S3 bucket or GitHub repository.

Finally, the CodeDeploy agent on each instance pulls the target revision from the Amazon S3 bucket or GitHub repository and, using the instructions in the AppSpec file, deploys the contents to the instance.

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

Blue/green deployments, What is it ?

A

A blue/green deployment is used to update your applications while minimizing interruptions caused by the changes of a new application version. CodeDeploy provisions your new application version alongside the old version before rerouting your production traffic.

AWS Lambda: Traffic is shifted from one version of a Lambda function to a new version of the same Lambda function.

Amazon ECS: Traffic is shifted from a task set in your Amazon ECS service to an updated, replacement task set in the same Amazon ECS service.

EC2/On-Premises: Traffic is shifted from one set of instances in the original environment to a replacement set of instances.

Note: All AWS Lambda and Amazon ECS deployments are blue/green. An EC2/On-Premises deployment can be in-place or blue/green.

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

For Amazon ECS and AWS Lambda there are three ways traffic can be shifted during a deployment:

A

Canary: Traffic is shifted in two increments. You can choose from predefined canary options that specify the percentage of traffic shifted to your updated Amazon ECS task set / Lambda function in the first increment and the interval, in minutes, before the remaining traffic is shifted in the second increment.

Linear: Traffic is shifted in equal increments with an equal number of minutes between each increment. You can choose from predefined linear options that specify the percentage of traffic shifted in each increment and the number of minutes between each increment.

All-at-once: All traffic is shifted from the original Amazon ECS task set / Lambda function to the updated Amazon ECS task set / Lambda function all at once.

17
Q

For Amazon EC2 you can choose how your replacement environment is specified ?

A

Copy an existing Amazon EC2 Auto Scaling group:

During the blue/green deployment, CodeDeploy creates the instances for your replacement environment during the deployment.

With this option, CodeDeploy uses the Amazon EC2 Auto Scaling group you specify as a template for the replacement environment, including the same number of running instances and many other configuration options.

Choose instances manually:

You can specify the instances to be counted as your replacement using Amazon EC2 instance tags, Amazon EC2 Auto Scaling group names, or both.

If you choose this option, you do not need to specify the instances for the replacement environment until you create a deployment.

18
Q
A