[Developer] Deployment Services Flashcards

CodeDeploy and Elastic Beanstalk (40 cards)

1
Q

What is AWS CodeDeploy?

A

A service that automates code deployments to a variety of compute services (EC2, Lambda, ECS, and Serverless).

It is infrastructure-agnostic.

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

What is the key configuration file used by CodeDeploy for EC2/on-premises deployments?

A

The appspec.yml file.

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

What is the purpose of the appspec.yml file?

A

It specifies the source files to copy and the lifecycle event hooks (scripts) to run during deployment.

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

What are the three main deployment configurations for an EC2/on-premises deployment?

A
  1. In-place
  2. Blue/Green
  3. Canary (for Lambda/ECS/EC2)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Which CodeDeploy deployment type replaces the old instances with a fresh set of new instances?

A

Blue/Green deployment.

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

What is the main benefit of a Blue/Green deployment over an In-Place deployment?

A

Zero downtime and instant rollback capability.

The entire environment is tested before traffic is shifted.

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

In an In-Place deployment, where is the application stopped, updated, and re-started?

A

Directly on the existing instances.

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

Where must the CodeDeploy Agent be installed for EC2 and on-premises deployments?

A

Directly on the EC2 instance or on-premises server.

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

What is the recommended deployment strategy for a Lambda function in CodeDeploy?

A

Canary (or Linear)

incrementally shifts traffic to the new version, using CloudWatch Alarms to monitor and auto-rollback on failure.

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

What is AWS Elastic Beanstalk (EB)?

A

A high-level Platform as a Service (PaaS) that handles the complexity of deploying, managing, and scaling web applications (including provisioning EC2, load balancers, etc.).

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

What is the key benefit of Elastic Beanstalk for a developer?

A

It allows the developer to focus only on writing code; Beanstalk handles all the underlying infrastructure management.

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

What kind of files do you provide to Beanstalk?

A

Only your application code/package (e.g., a .zip or .jar file).

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

Which tool does Beanstalk use under the hood to provision and update the underlying resources?

A

AWS CloudFormation.

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

How does a developer configure custom infrastructure settings (e.g., install specific packages or set environment variables) in a Beanstalk environment?

A

By adding .ebextensions configuration files to the application source code bundle.

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

If you need to perform a database migration during a Beanstalk deployment, which deployment type should you use to ensure safety and zero downtime?

A

Blue/Green (or possibly Immutable).

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

What is the difference between an EB Environment and an EB Application?

A

An Application is a logical collection of components (templates, versions). An Environment is a specific, running instance of an Application Version (e.g., production or staging).

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

What deployment option does EB use that involves launching new instances with the new code and then terminating the old ones?

A

Immutable deployment (provides a safe rollback and zero downtime).

18
Q

What is AWS CodePipeline?

A

A Continuous Delivery (CD) service that automates the release process for application and infrastructure updates, following a defined workflow.

19
Q

What are the 2 core components of a CodePipeline workflow?

A
  1. Stages (e.g., Source, Build, Deploy)
  2. Actions (the tasks performed within a stage).
20
Q

What is the typical flow of data between stages in CodePipeline?

A

Artifacts.

The output artifact of one stage is the input artifact of the next stage.

21
Q

Where does CodePipeline store the artifacts (source code, build files) that pass between stages?

A

An S3 bucket

(created and managed by the pipeline itself).

22
Q

In CodePipeline

What is the purpose of the Source Stage?

A

To pull the latest code from a source repository (e.g., CodeCommit, GitHub, S3) and place it into the S3 artifact store.

23
Q

In CodePipeline

What is the primary AWS service used in the Build Stage?

A

AWS CodeBuild.

24
Q

In CodePipeline

What is the primary AWS service used in the Deploy Stage when deploying to EC2/on-premises?

A

AWS CodeDeploy.

25
How can you introduce a manual approval step into a CodePipeline pipeline?
By adding an **Approval Action** as a step in any stage of the pipeline.
26
How does CodePipeline integrate with CloudFormation to deploy infrastructure?
Using the **CloudFormation Action**, which can create, update, or delete a CloudFormation stack.
27
What is the simplest way to roll back a failing deployment in CodePipeline?
Re-run the pipeline using a previous, successful revision from the Source Stage.
28
How does CodePipeline handle a failure in any stage?
The pipeline **stops execution** at the point of failure, and the deployed resources are left in their current state (no automatic rollback).
29
How can a developer use Lambda for testing or automation within a CodePipeline stage?
Use a CodePipeline action that invokes a Lambda function to perform custom tasks (e.g., security checks, custom notifications).
30
How does CodePipeline roll back existing resources after a failure part of the way through a deployment?
There is **no automatic rollback**, but you can **configure lifecycle hooks** in the `appspec.yml` file for cleanup.
31
How do you configure a CodePipeline in Account A to deploy resources into Account B?
Configure an **IAM Cross-Account Role** in Account B that has the necessary deployment permissions and trusts the CodePipeline Service Role in Account A.
32
When should a developer choose AWS Elastic Beanstalk over AWS Amplify?
Beanstalk is for **traditional, server-based applications** (e.g., Tomcat, Python, Docker) where the developer needs some control over the EC2/OS level, but still wants managed infrastructure.
33
What `appspec.yaml` lifecycle hook is used for **graceful stopping** of an application?
`ApplicationStop`
34
A developer is implementing CI/CD using CodePipeline. The source stage uses CodeCommit. How should the pipeline be automatically triggered when code is pushed to the repository?
Use an Amazon CloudWatch Event Rule (or EventBridge) listening for CodeCommit events.
35
What exactly is the benefit of the deployment strategy of "rolling _with an additional batch_"?
It guarantees that the Auto Scaling Group capacity is never reduced during the deployment
36
Which component is responsible for rerouting traffic from the 'Blue' (old) environment to the 'Green' (new) environment?
CodeDeploy uses the **load balancer (ALB/NLB)** to swap the target group associated with the production listener from the old (Blue) environment to the new (Green) environment.
37
Which deployment type in CodeDeploy is required for AWS Lambda functions?
Blue/Green
38
What Cloudformation intrinsic is used to get the **canonical name or id** of a resource?
`!Ref`
39
What Cloudformation intrinsic is used to get **metadata** about a resource?
`!GetAtt`
40
What Cloudformation Intrinsic is used to get data **from another stack**?
`!ImportValue`