AWS - Dev Tools, CLI, CICD Flashcards

1
Q

Key terms for the AWS CI/CD pipeline?

A
  • CodeCommit = source control
  • CodeBuild = manages builds and testing
  • CodeDeploy = deploys to EC2, Fargate, Lambda, on-prem, etc
  • CodePipeline = manages the CI/CD pipeline
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the CodeBuild config file called? 4 main stages? 2 other things you can define?

A

buildspec.yml
- Has to be located in the root of the source

Stages:
1. install - installing packages from the build env (frameworks)
2. pre_build - sign in to things or install dependencies
3. build - commands run during the build process
4. post_build - package things up, push Docker image, do explicit notifications, etc.

Other things you can define:
1. Environment variables, which can integrate with the Parameter Store or Secrets Manager
2. Artifacts - what stuff to put where

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

What is the CodeDeploy config file called?

A

appspec.yml (or .json)

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

What are the 8 possible deployment targets of CodePipeline?

A
  • CodeDeploy
  • EC2 / ECS (also can use Blue/Green deployment model)
  • Elastic Beanstalk
  • Service Catalog
  • Alexa Skills Kit
  • S3
  • OpsWorks
  • CloudFormation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How do you set up authentication and authorization for CodeCommit, CodeDeploy, CodePipeline?

A

Authentication:
> Create one of the following in IAM:
- HTTPS Git Credentials (username / password)
- SSH Keys
Authorization:
> Configured using IAM Identity Policies. Very granular.

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

What two things can be generated from Code* events?

A
  • Notifications
    • Send to either SNS or Chatbot (Slack)
  • Triggers
    • Invoke Lambda function or SNS notification
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the main components used by CodePipeline?

A

Pipelines are the main components, which are built from:
- Stages, which are built from sequential or parallel:
- Actions, which can consume or generate:
- Artifacts

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

What system stores a record of CodePipeline events?
How to find events coming either from API calls or human interaction?

A
  • Any state changes generate events that go to Event Bridge (Success, Failed, Cancelled)
  • Use CloudTrail to monitor API calls
  • Use the Console UI to monitor human interaction
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What service uses Appspec.yml? What 2 main components does it specify?

A
  • CodeDeploy. Can also be called Appspec.json.
  • Contains both configs and lifecycle event hooks.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What 3 main components can the configs section define in the CodeDeploy Appspec.yml / json file?

A
  • Files: applies to EC2 & on-prem servers. Determines which things to be installed.
  • Permissions: details any special permissions that should be applied to be files, directories, etc. in the Files section.
    • ONLY applies to EC2 or on-prem servers.
  • Resources -> applies to ECS & Lambda
    • ECS: contains task definition, or container and port details = configs for the thing running your application
    • Lambda: contains name, alias, current version, target version of a Lambda function
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How do Lifecycle Event Hooks work in the CodeDeploy Appspec.yml / json file?

A
  • If you’re using EC2 or on-prem servers, these hooks each run 1 script
  • For Lambda or ECS, these hooks specify Lambda functions to run at each step.
  • Examples:
    • ApplicationStop: used to prepare for the deployment
    • DownloadBundle: before copying files to a local location
    • BeforeInstall
    • Install
    • AfterInstall
    • ApplicationStart
    • ValidateService: Enables CodeDeploy to validate whether the deployment worked as expected. You can run whatever checks or query logs, etc.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly