Code* Flashcards
This deck aims to help retain concepts related to the CodeCommit, CodeArtifact, CodeBuild, CodeDeploy, CodePipeline, and CodeGuru services.
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?
AWS CodeCommit
Which compliance programs is AWS CodeCommit in scope with?
- HIPAA
- ISO 27001
- PCI DSS
- FIPS 140-2
What connection options does AWS CodeCommit support for accessing repositories?
- HTTPS: Requires authentication via username and password
- SSH: Requires an SSH key-pair
Both of which can be configured for an IAM user
How many triggers can be configured for a single AWS CodeCommit repository?
Up to 10 triggers
What AWS service is a fully managed artifact repository designed to securely store, publish, and share software packages during the development process?
AWS CodeArtifact
Which build tools and package managers are supported by AWS CodeArtifact?
- NuGet CLI
- Maven, Gradle
- npm, yarn
- pip, twine
Are there any limitations on the number or total size of packages that can be stored in AWS CodeArtifact?
No, there are no limits
What AWS service provides developers with intelligent recommendations to enhance code quality and pinpoint an application’s most expensive lines of code?
AWS CodeGuru
What AWS service provides a fully managed Continuous Integration (CI) service that compiles source code, runs tests, and generates deployable artifacts?
AWS CodeBuild
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?
buildspec.yml
, must be located at the root of the source code
What are the four phases defined in the buildspec.yml
file used by AWS CodeBuild?
- 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
What information can be defined in the buildspec.yml
file within AWS CodeBuild?
- 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
What service is used by AWS CodeBuild as an artifact repository by default?
S3
What is the billing model of the AWS CodeBuild service?
Billed based on the compute resources consumed during the build process
What platform does AWS CodeBuild use to create consistent build environments?
Docker
Which programming languages are natively supported by AWS CodeBuild for build environments?
Java, Ruby, Python, Node.js, PHP, .NET, Go, and more
Custom environments (using Docker images to support additional languages and tools)
What sources can AWS CodeBuild use to retrieve source code?
- CodeCommit
- CodePipeline
- S3
- GitHub
- GitHub Enterprise
- GitLab
- GitLab Self Managed
- Bitbucket
What AWS service provides a fully managed deployment service that automates application deployments to AWS EC2, AWS Lambda, AWS ECS, and on-premises servers?
AWS CodeDeploy
What lifecycle event hooks can be defined in the appspec.yml
file used by AWS CodeDeploy?
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
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?
appspec.yml
or appspec.json
What information can be defined in the appspec.yml file within AWS CodeDeploy?
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
What piece of software is required for AWS CodeDeploy to deploy applications to on-premises servers?
AWS CodeDeploy Agent
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?
AWS CodePipeline
Is a pipeline defined in AWS CodePipeline linked to the entire repository?
No, a pipeline is linked to a single branch within the repository
What is the main building block in AWS CodePipeline that defines each pipeline step?
Stage
What is the minimum number of stages required in AWS CodePipeline?
At least two stages: a source stage and another stage for either build or deployment
What are the smallest building blocks within a Stage in AWS CodePipeline?
Actions, which can be sequential or parallel
What are the two types of stage transitions in AWS CodePipeline?
- Automatic
- Manual Approval
How can Actions within an AWS CodePipeline Stage interact with artifacts?
- Consume artifacts (input artifact)
- Generate artifacts (output artifact)
What authentication methods are supported by AWS CodeCommit?
- Git credentials (IAM-generated username and password)
- SSH keys
- AWS access keys
What are the best practices for using Jenkins with AWS CodePipeline for build or test actions?
- Install Jenkins on an Amazon EC2 instance
- Configure an instance profile that grants Jenkins only the necessary AWS permissions for its tasks
What actions can override the default buildspec in AWS CodeBuild?
- Using the
create-project
orupdate-project
command with thebuildspec
parameter set to the path of the alternate buildspec file - Using the
start-build
command with thebuildspecOverride
parameter set to the path of the alternate buildspec file - In a CloudFormation template, setting the
BuildSpec
property of theSource
to the path of the alternate buildspec file
What AWS CodeDeploy lifecycle event hook is used to execute tasks before traffic is shifted to the deployed Lambda function version?
BeforeAllowTraffic
What AWS CodeDeploy lifecycle event hook allows tasks to run after all traffic has been shifted to the deployed Lambda function version?
AfterAllowTraffic
If the AWS CodeDeploy log file is accidentally deleted, what action can be taken to recreate the log file?
Restart the CodeDeploy Agent service
What should be done if an AWS CodeDeploy deployment fails to start with a HEALTH_CONSTRAINTS_INVALID
error code?
Either reduce the number of required healthy instances by updating the deployment configuration or increase the number of instances in the deployment group
How do you configure AWS CodeBuild for scaling and running builds in parallel?
AWS CodeBuild automatically scales to meet the demand, eliminating the need to provision and manage servers
What software package is required on AWS EC2 instances for AWS CodeDeploy deployments?
AWS CodeDeploy Agent
Which configuration option in the AWS CodeDeploy Agent specifies the maximum number of application revisions to archive?
max_revisions
What AWS CodeBuild best practice helps to reduce build time by avoiding the repeated downloads of unchanged dependencies?
Cache dependencies in S3 bucket
What is the required permission for AWS CodeBuild to upload build outputs to S3?
Permissions to put objects in an S3 bucket
How does AWS CodeDeploy handle rollbacks?
CodeDeploy rolls back deployments by creating a new deployment of a previously deployed revision, using new deployment IDs
What AWS service enables quick development, building, and deployment of applications with a unified interface and integrated CI/CD toolchain?
AWS CodeStar
How can you troubleshoot AWS CodeBuild locally before committing changes?
By testing the integrity of the buildspec file, building the application locally, and identifying errors in your development environment