Section 9: AWS CICD: CodeCommit, CodePipeline, CodeBuild, CodeDeploy Flashcards

1
Q

What does CI/CD stand for?

A

Continuous Integration / Continuous Delivery

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

What does Continuous Integration look like?

A

A developer pushes code to online repository
A testing/build server checks the code as itโ€™s pushed
The developer gets feedback about the tests that have passed/failed

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

What are the benefits of CI?

A

Find bugs early, fix bugs
Deliver faster as the code is tested
Deploy often
Happier developers

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

What are the benefits of CD?

A

Shift away from โ€œone release every 3 monthsโ€ to โ€5 releases a dayโ€

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

What does the development process look like when doing CICD?

A
Code
Build
Test
Deploy
Provision
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is AWS CodeCommit?

A

AWS CodeCommit is a fully-managed source control service that hosts secure Git-based repositories.

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

What is the size limit of CodeCommit repos?

A

No size limit

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

With what CI tools can CodeCommit be integrated with?

A

AWS CodeBuild, Jenkins, other

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

What authentication options are available to establish a connection to AWS CodeCommit from your workstation? (2)

A

SSH Keys

HTTPS

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

How to setup SSH authentication to establish a connection to AWS CodeCommit?

A

By setting your public ssh-rsa key in your IAM user security credentials tab and creating a โ€œconfigโ€ file in your .ssh directory on your machine with the following content:

Host git-codecommit.*.amazonaws.com
User XXXXXXXXXXXXXXXXX
IdentityFile ~/.ssh/codecommit_rsa

Where โ€œXXXXXXXXXXXXXXXXXโ€ is your SSH key ID (provided by AWS when you upload your SSH public key) and โ€œcodecommit_rsaโ€ is the name of the file containing your private SSH key.

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

How to setup HTTPS authentication to establish a connection to AWS CodeCommit?

A

By generating HTTPS git credentials in your IAM user security credentials tab and entering the username and password AWS provides you with in the Windows popup which will appear when doing your first git clone.

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

Is there a distinction in the URL to use when using SSH or HTTPS when cloning from git?

A

Yes, HTTPS and SSH have different urls.

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

What manages authorization in AWS CodeCommit?

A

IAM Policies manage user / roles rights to repositories

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

Is there encryption in CodeCommit?

A

Yes, repos are automatically encrypted at rest using KMS and in transit (can only use HTTPS or SSH - both secure)

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

How to provide cross-account access to your Git repositories in AWS CodeCommit?

A

Setup an IAM Role in your account and tell him to use STS cross-account access to assume that role (with AWS STS AssumeRole API)

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

What is the difference between triggers and notifications in CodeCommit?

A

Triggers are triggered by branch creation, deletion, or pushes to an existing branch. They can publish (with custom data) to an SNS topic or call an AWS Lambda function directly

Notifications are triggered by CloudWatch Events and get published to SNS topics you define

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

What is AWS CodePipeline?

A

AWS CodePipeline is a fully managed continuous delivery service. It automates the build, test, and deploy phases of your release process every time there is a code change.

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

What are some deploy options in CodePipeline?

A

AWS CodeDeploy, Beanstalk, CloudFormation, ECS, etc.

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

What are pipelines essentially made of?

A

Stages

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

What are stages essentially made of?

A

Action groups

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

What do action groups represent?

A

Parallel actions

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

Can you have more than one action group per stage?

A

Yes

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

In what order are action groups executed in a stage?

A

In sequence

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

What sources are available in CodePipeline?

A

CodeCommit, GitHub, Amazon S3, Amazon ECR, Bitbucket

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
What is the output of each stage in a CodePipeline?
Artifacts
26
Where are artifacts stored?
In an S3 bucket
27
Where do CodePipeline state changes events happen?
In AWS CloudWatch Events
28
How to set up events for failed pipelines and cancelled stages?
By creating corresponding event rules in CloudWatch
29
What will happen to the pipeline if a stage fails?
It will stop and you will get information in the console
30
How to audit AWS API calls?
By using AWS CloudTrail
31
What should you check if CodePipeline can't perform an action?
Make sure the IAM Service Role attached does have enough permissions (IAM Policy)
32
What is AWS CodeBuild
A fully managed build service. An alternative to other build tools such as Jenkins.
33
What does AWS CodeBuild leverages to get reproducible builds?
Docker
34
What do you pay for when using AWS CodeBuild?
Pay for usage (time it takes to complete the builds)
35
How does AWS CodeBuild scale (in regards to how the developer uses the service)?
Continuously (no servers to manage)
36
What can you do if AWS doesn't provide you with a compatible Docker image for your project?
Provide your own
37
Is CodeBuild secure?
Yes, it integrates with KMS for artifacts, IAM for build permissions, VPC for network and CloudTrail for API calls logging
38
Where should build instructions be when using CodeBuild?
In a buildspec.yml file at the root of the source code
39
Where can CodeBuild send logs?
To an S3 bucket | To AWS CloudWatch
40
What can you use to detect failed builds and trigger notifications?
CloudWatch events
41
What can you use if you need to set failure "tresholds" and get notifications?
CloudWatch alarms
42
How to troubleshoot your CodeBuild?
By looking at the logs in S3 By looking at the logs in CloudWatch By reproducing CodeBuild locally (it's an available feature)
43
Where can CodeBuild reside / be used?
Within a CodePipeline | Standalone
44
What environment does CodeBuild support?
``` Java Ruby Python Go Node.js Android .NET Core PHP Docker: extend any environment you like ```
45
What type of environment variables are available in CodeBuild?
Plaintext variables | SSM Parameter Store
46
What are the four phases of a CodeBuild and what do they do?
Install (Install depencies) Pre build (Cmds to execute before build) Build (Actual build) Post build (Cleanup, finishing touches)
47
What to put in Artifacts section of buildspec.yml file?
Files to upload to S3
48
What to put in Cache section of buildspec.yml file?
Files to cache to S3 (usually dependencies) for future build speedup
49
What do you need in order to run CodeBuild locally?
Docker | CodeBuild Agent
50
What is AWS CodeDeploy and what problem does it solve?
AWS CodeDeploy is a fully managed deployment service that automates software deployments to a variety of compute services.
51
What is AWS CodeDeploy not built for?
Deploying to EB. EB is an end-to-end application management solution.
52
What compute services can AWS CodeDeploy deploy code to?
Amazon EC2 instances and your on-premises servers
53
What do machines (EC2/your on premise servers) need to be able to work with CodeDeploy?
The CodeDeploy Agent installed and running
54
What is the CodeDeploy agent doing continuously?
Polling AWS CodeDeploy for work to do
55
Where is the application pulled from by the compute services when a new version is ready to be installed? (2 options)
S3 | GitHub
56
When using AWS CodeDeploy, who runs the deployment instructions?
The machines installing the updates themselves
57
What happens if a machine running the CodeDeploy agent fails to complete the deployment instructions it needed to do?
The CodeDeploy Agent will report it to AWS CodeDeploy
58
What happens if a machine running the CodeDeploy agent succeeds in completing the deployment instructions it needed to do?
The CodeDeploy Agent will report it to AWS CodeDeploy
59
Where must the deployment instructions be when using AWS CodeDeploy?
In an appspec.yml file located at the root level of the source code
60
How to group instances in AWS CodeDeploy? (dev, prod, other)
By using deployment groups
61
Does CodeDeploy work with any application?
Yes
62
Does CodeDeploy support auto scaling integration?
Yes
63
Does Blue/Green work with on premise machines?
No, only EC2 instances
64
Does CodeDeploy provision resources?
No
65
What are the primary components of AWS CodeDeploy?
``` Application Compute platform (EC2/On premise or Lambda) Deployment configuration (Rules for success/failure) Deployment group (group of tagged instances) Deployment type IAM instance profile (Need to give EC2 permission to pull from S3/GitHub) Application Revision (Application code + appspec.yml) Service Role (Role for CodeDeploy to perform what it needs) Target Revision (Target deployment application version) ```
66
What consists of the deployment configuration of AWS CodeDeploy when deploying lambdas?
Deployment rules for success/failure | Specification about how traffic is routed to the updated Lamdba version
67
What is present in an appspec.yml file?
File selection | Hooks
68
What are hooks in AWS CodeDeploy
Set of instructions to do to deploy the new version
69
What are the main hooks in AWS CodeDeploy
``` ApplicationStop DownloadBundle BeforeInstall Install AfterInstall ApplicationStart ValidateService BeforeAllowTraffic AllowTraffic AfterAllowTraffic ```
70
What hook in AWS CodeDeploy should be used to make sure our app is running correctly on its instance?
ValidateService
71
What happens to instances that fail when using CodeDeploy until new deployment?
They stay in "failed state"
72
What instances are targetted first when deploying through CodeDeploy?
Instances which are in "Failed state"
73
How "fix" instances in "Failed state"
Redeploy old deployment or enable automated rollback
74
What are the available deployment targets when using CodeDeploy?
Set of EC2 instances with tags Directly to an ASG (with a certain tag) Mix of ASG/Tags
75
How can you customize CodeDeploy scripts?
By using environment variables such as DEPLOYMENT_GROUP_NAME
76
What is in place deployment when using CodeDeploy?
A certain percentage of the instances at a time get deregistered from the LB to perform their update/deployment and then get re-registered
77
What is Blue/Green deployment when using CodeDeploy?
Similar to how Beanstalk does it. New instances get created and new version of the application is installed on those instances. DNS points to the new instances and the old instances get terminatted.
78
What is CodeStar?
An integrated solution that regroups: GitHub, CodeCommit, CodeBuild, CodeDeploy, CloudFormation, CodePipeline, CloudWatch
79
What is the pricing of CodeStar?
It is free, you only pay for the underlying resources
80
What is Cloud9?
A web IDE provided by AWS. Not available in all regions.
81
What does CodeStar help us with?
Quickly create CICD projects for EC2, Lambda, Beanstalk