Code* Flashcards

This deck aims to help retain concepts related to the CodeCommit, CodeArtifact, CodeBuild, CodeDeploy, CodePipeline, and CodeGuru services.

1
Q

What AWS service provides a secure, scalable, and managed source control solution designed for teams to privately store, manage, and collaborate on assets such as source code, documents, and binary files?

A

AWS CodeCommit

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

Which compliance programs is AWS CodeCommit in scope with?

A
  • HIPAA
  • ISO 27001
  • PCI DSS
  • FIPS 140-2
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What connection options does AWS CodeCommit support for accessing repositories?

A
  • HTTPS: Requires authentication via username and password
  • SSH: Requires an SSH key-pair

Both of which can be configured for an IAM user

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

How many triggers can be configured for a single AWS CodeCommit repository?

A

Up to 10 triggers

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

What AWS service is a fully managed artifact repository designed to securely store, publish, and share software packages during the development process?

A

AWS CodeArtifact

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

Which build tools and package managers are supported by AWS CodeArtifact?

A
  • NuGet CLI
  • Maven, Gradle
  • npm, yarn
  • pip, twine
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Are there any limitations on the number or total size of packages that can be stored in AWS CodeArtifact?

A

No, there are no limits

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

What AWS service provides developers with intelligent recommendations to enhance code quality and pinpoint an application’s most expensive lines of code?

A

AWS CodeGuru

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

What AWS service provides a fully managed Continuous Integration (CI) service that compiles source code, runs tests, and generates deployable artifacts?

A

AWS CodeBuild

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

What is the name of the file, written in YAML format, that AWS CodeBuild uses to define build settings and commands, which can be included in the source code or specified during build project creation?

A

buildspec.yml, must be located at the root of the source code

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

What are the four phases defined in the buildspec.yml file used by AWS CodeBuild?

A
  • install: Installs required packages
  • pre_build: Performs preparatory steps
  • build: Executes commands during the actual build
  • post_build: Handles final tasks, such as packaging artifacts, pushing Docker images, or sending notifications
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What information can be defined in the buildspec.yml file within AWS CodeBuild?

A
  • run-as: Linux user that runs commands in the build
  • env: Custom environment variables for the build
  • proxy: Configures an explicit proxy server for the build
  • batch: Settings for batch builds
  • phases: Commands to be executed during each build phase
  • reports: Defines the report groups to which build reports are sent
  • artifacts: Specifies artifacts related settings
  • cache: Configures file caching to speed up subsequent builds
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What service is used by AWS CodeBuild as an artifact repository by default?

A

S3

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

What is the billing model of the AWS CodeBuild service?

A

Billed based on the compute resources consumed during the build process

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

What platform does AWS CodeBuild use to create consistent build environments?

A

Docker

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

Which programming languages are natively supported by AWS CodeBuild for build environments?

A

Java, Ruby, Python, Node.js, PHP, .NET, Go, and more

Custom environments (using Docker images to support additional languages and tools)

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

What sources can AWS CodeBuild use to retrieve source code?

A
  • CodeCommit
  • CodePipeline
  • S3
  • GitHub
  • GitHub Enterprise
  • GitLab
  • GitLab Self Managed
  • Bitbucket
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What AWS service provides a fully managed deployment service that automates application deployments to AWS EC2, AWS Lambda, AWS ECS, and on-premises servers?

A

AWS CodeDeploy

18
Q

What lifecycle event hooks can be defined in the appspec.yml file used by AWS CodeDeploy?

A

Lifecycle event hooks depend on the compute platform used for deployment:
- ApplicationStop: To stop the app
- DownloadBundle: Copies the application to a temporary location
- BeforeInstall: Executes tasks before installing the application
- Install: Copies the application to its final location
- AfterInstall: Executes tasks after installing the application
- ApplicationStart: Starts or restarts the service that was stopped
- ValidateService: Validates that the application is running correctly

18
Q

What is the name of the file, written in YAML or JSON format, that AWS CodeDeploy uses to manage a deployment, which can be included in the source code or specified during deployment project creation?

A

appspec.yml or appspec.json

19
Q

What information can be defined in the appspec.yml file within AWS CodeDeploy?

A

For all deployments:
- version: Specifies the version of the appspec.yml file
- permissions: Defines special file or directory permissions to apply
- hooks: Specifies scripts to run during deployment lifecycle events

For EC2/on-premises deployments:
- os: Specifies the operating system
- files: Specifies the files to be copied during the deployment

For ECS/Lambda deployments:
- resources: specifies information about the ECS application/Lambda function to deploy

20
Q

What piece of software is required for AWS CodeDeploy to deploy applications to on-premises servers?

A

AWS CodeDeploy Agent

21
Q

What AWS service represents a Continuous Delivery (CD) service used to model, visualize, and automate the stages required to release software changes continuously, serving as a glue or orchestrator for CodeCommit, CodeBuild, and CodeDeploy services?

A

AWS CodePipeline

22
Q

Is a pipeline defined in AWS CodePipeline linked to the entire repository?

A

No, a pipeline is linked to a single branch within the repository

23
Q

What is the main building block in AWS CodePipeline that defines each pipeline step?

24
Q

What is the minimum number of stages required in AWS CodePipeline?

A

At least two stages: a source stage and another stage for either build or deployment

25
Q

What are the smallest building blocks within a Stage in AWS CodePipeline?

A

Actions, which can be sequential or parallel

26
Q

What are the two types of stage transitions in AWS CodePipeline?

A
  • Automatic
  • Manual Approval
27
Q

How can Actions within an AWS CodePipeline Stage interact with artifacts?

A
  • Consume artifacts (input artifact)
  • Generate artifacts (output artifact)
28
Q

What authentication methods are supported by AWS CodeCommit?

A
  • Git credentials (IAM-generated username and password)
  • SSH keys
  • AWS access keys
29
Q

What are the best practices for using Jenkins with AWS CodePipeline for build or test actions?

A
  1. Install Jenkins on an Amazon EC2 instance
  2. Configure an instance profile that grants Jenkins only the necessary AWS permissions for its tasks
30
Q

What actions can override the default buildspec in AWS CodeBuild?

A
  • Using the create-project or update-project command with the buildspec parameter set to the path of the alternate buildspec file
  • Using the start-build command with the buildspecOverride parameter set to the path of the alternate buildspec file
  • In a CloudFormation template, setting the BuildSpec property of the Source to the path of the alternate buildspec file
31
Q

What AWS CodeDeploy lifecycle event hook is used to execute tasks before traffic is shifted to the deployed Lambda function version?

A

BeforeAllowTraffic

32
Q

What AWS CodeDeploy lifecycle event hook allows tasks to run after all traffic has been shifted to the deployed Lambda function version?

A

AfterAllowTraffic

33
Q

If the AWS CodeDeploy log file is accidentally deleted, what action can be taken to recreate the log file?

A

Restart the CodeDeploy Agent service

34
Q

What should be done if an AWS CodeDeploy deployment fails to start with a HEALTH_CONSTRAINTS_INVALID error code?

A

Either reduce the number of required healthy instances by updating the deployment configuration or increase the number of instances in the deployment group

35
Q

How do you configure AWS CodeBuild for scaling and running builds in parallel?

A

AWS CodeBuild automatically scales to meet the demand, eliminating the need to provision and manage servers

36
Q

What software package is required on AWS EC2 instances for AWS CodeDeploy deployments?

A

AWS CodeDeploy Agent

37
Q

Which configuration option in the AWS CodeDeploy Agent specifies the maximum number of application revisions to archive?

A

max_revisions

38
Q

What AWS CodeBuild best practice helps to reduce build time by avoiding the repeated downloads of unchanged dependencies?

A

Cache dependencies in S3 bucket

39
Q

What is the required permission for AWS CodeBuild to upload build outputs to S3?

A

Permissions to put objects in an S3 bucket

40
Q

How does AWS CodeDeploy handle rollbacks?

A

CodeDeploy rolls back deployments by creating a new deployment of a previously deployed revision, using new deployment IDs

41
Q

What AWS service enables quick development, building, and deployment of applications with a unified interface and integrated CI/CD toolchain?

A

AWS CodeStar

42
Q

How can you troubleshoot AWS CodeBuild locally before committing changes?

A

By testing the integrity of the buildspec file, building the application locally, and identifying errors in your development environment