Chapter 7 Deployment as Code Flashcards

1
Q

How to define CodePipeline workflow steps? In other words, what tools allow you to define the steps?

A

Visual editor via AWS Management Console or through JSON with CLI/SDK

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

Can you change the name of a pipeline?

A

No, you must create a new one.

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

What does the term ‘source revision’ refer to?

A

Change in source code triggers pipeline execution. The version of code in this scenario is the ‘source revision’.

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

Name the types of ‘source revision’ sources for CodePipeline.

A

Git repositories and versioned S3 Buckets.

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

What happens when an action fails in a CodePipeline?

A

The revision does not pass to the next stage.

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

What is only stage which can contain source actions?

A

The first stage

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

Every action in a stage must have…

A

a unique name.

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

Approval actions in a CodePipeline expire in ____ days.

A

7

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

Explain the ‘invoke’ action in CodePipeline

A

Lambda integration. Can be used for a wide variety of things like:

  1. backing up data volumes, DBs, buckets
  2. interact w/ 3rd party APIs
  3. update IAM roles
  4. Stage swap in Elastic Beanstalk (blue/green deployment)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Explain the S3 artifact bucket used in CodePipeline

A

The input and output artifacts of each stage from from and are sent to an S3 artifact bucket. Refer to picture from chapter.

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

Transitions

A

Point in pipeline where execution moves from one stage to the next. If a transition is disabled and multiple revision arrive at the transition, only the last one (most recent) will be allowed to proceed when the transition is re-enabled.

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

Maximum artifact size for CodePipeline

A

256MB

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

Available providers for deployment stage in CodePipeline

A
  1. ECS
  2. CloudFormation
  3. CodeDeploy
  4. Elastic Beanstalk
  5. OpWorks Stacks
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Maximum size for Elastic Beanstalk deployment

A

512MB

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

Can CodePipeline deploy across different accounts?

A

Yes, but if sourcing from S3, the bucket must pertain to pipeline account

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

Example uses of repository triggers

A
  1. Start external build
  2. notify administrators of code push
  3. perform unit tests
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

In the case of sensitive values for build jobs, what is alternative to setting environment variables?

A

AWS Systems Manager Parameter Store. Using environment variables will result in plaintext appearing in CLI/Console/SDK

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

buildspec.yml

A

provides the build specifications for projects in AWS CodeBuild

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

phases of CodeBuild

A
  1. install
  2. pre_build
  3. build`
  4. post_build
  5. artifacts (where to place artifacts)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

OS build environments available in CodeBuild

A

Amazon Linux and Ubuntu

21
Q

What is a ‘revision’ in the context of CodeDeploy?

A

Artifact that contains both the application files to deploy and an AppSpec configuration file.

  • appSpec must be located at root
  • for Lambda deployment, revision only contains AppSpec
22
Q

Lambda deployments only support ____ as the source repository

A

S3 Buckets

23
Q

When a code revision is ready to deploy, you 1.______ it into a/an 2. _____.

A
  1. package

2. archive file (.zip)

24
Q

What are the two types of deployments supported by CodeDeploy?

A
  1. In-place

2. blue/green

25
Q

How to handle failed deployments?

A

Configure automatic rollbacks in AWS CodeDeploy.

-This has added benefit of removing any successfully created files

26
Q

What is an issue with a stopped deployment, and how to you address it?

A

In the event of a stopped deployment, some instances will be in an undesired state (i.e. wrong/difference application version). You can effectively rollback by launching a new deployment with the previous revision.

27
Q

What is a limitation of the CodeDeploy rollback process?

A

Scripts executed on an instance cannot be rolled back. For these types of files, you must manually ensure that the instance is reverted to a proper state.

28
Q

How to test whether a revision will successfully deploy to an instance?

A

Use the codedeploy-local command in the CodeDeploy agent. The agent searches for an AppSpec file and attempts a deployment on the instance and provide feedback.

29
Q

What can be configured for a deployment group (CodeDeploy)?

A
  1. SNS notifications
  2. CloudWatch Alarms
  3. Auto Rollbacks
30
Q

CodeDeploy Deployment Configurations

A
  1. AllAtOnce: only 1 instance needs to succeed
  2. HalfAtATime: only half of instances need to succeed
  3. OneAtATime: all but final instance need to succeed
31
Q

CodeDeploy supports 3 methods for handling traffic switching in Lambda:

A
  1. Canary: two percentage based increments
  2. Linear: number of percentage based increments
  3. All at Once
32
Q

Application (in context of CodeDeploy)

A

logical grouping of deployment group, revision, and deployment configuration.

33
Q

Main CodePipeline stages

A

build, test, deploy, invoke

34
Q

What is required for on prem EC2 deployments?

A

Installation of the CodeDeploy agent

35
Q

What is the credential helper?

A

Tool which allows access to CodeCommit repositories using IAM credentials (requires AWS CLI and proper Git configuration)

36
Q

Requirements for cross account pipeline

A
  1. pipeline account must create KMS key available to both accounts
  2. pipeline account must specify bucket policy for second account (grant access)
  3. AWS CodePipeline IAM role must include policy that lets it assume role in other account
  4. other account must have role assumed by pipeline account
37
Q

You have two AWS CodeDeploy applications that deploy to the same Amazon EC2 Auto Scaling group. The first deploys an e-commerce app, while the second deploys custom administration software. You are attempting to deploy an update to one application but cannot do so because another deployment is already in progress. You do not see any instances undergoing deployment at this time. What could be the cause of this?

A

If both deployment groups reference the same Auto Scaling group, a failure of the first group’s deployment can block the second until the deployment times out. Since the instance that failed deployment has been terminated from the Auto Scaling group, the AWS CodeDeploy agent is unable to provide results to the service.

38
Q

If a single pipeline contains multiple sources, such as an AWS CodeCommit repository and an Amazon S3 archive, under what circumstances will the pipeline be triggered?

A

When either a commit is pushed to the repository or the archive is updated, regardless of timing.

39
Q

T/F: AWS CodePipeline does not support multiple sources in the same pipeline.

A

False

40
Q

If you want to implement a deployment pipeline that deploys both source files and large binary objects to instance(s), how would you best achieve this while taking cost into consideration?

A

store the source files in AWS CodeCommit. Store the binary objects in an Amazon S3 archive.

41
Q

Why are blue/green deployments not considered a lowest cost option?

A

The original environment will be left intact, accruing charges until it is manually deleted.

42
Q

Compare rolling deployments with additional batches to immutable deployments.

A

Both are cost effective and have 100% availability. However, immutable deployments are faster because everything is deployed at once.

43
Q

Compare blue/green deployments to immutable deployments in the context of Elastic Beanstalk

A

Blue/green involves creating new environment and performing a CNAME swap (and terminating old environment)

Immutable uses same environment. A new temporary autoscaling group is added to environment and new instances are launched into the the temporary auto scaling group. After health checks, instances are transferred from the temp ASG into original one. Finally, old instances (and temp ASG) are terminated.

44
Q

How do you output build artifacts from AWS CodeBuild to AWS CodePipeline?

A

Specify artifact files in the buildspec.yml configuration file

45
Q

In what ways can pipeline actions be ordered in a stage?

A

series and parallel

46
Q

Can data passed to build projects using environment variables be encrypted or protected?

A

No, but this can be supported using other AWS products and services (SMPS)

47
Q

What is the only deployment type supported by on-premises instances?

A

in-place

48
Q

If your AWS CodeDeploy configuration includes creation of a file, nginx.conf, but the file already exists on the server (prior to the use of AWS CodeDeploy), what is the default behavior that will occur during deployment?

A

the deployment will fail