AWS Certified Developer Exam Notes – CI/CD

CodeCommit

  • Git Version Control
  • No size limit on repositories
  • Authentication with SSH keys or HTTPs 
  • Authorization with IAM policies. Configure Git credentials for CodeCommit in the IAM console
  • Automatic encryption at rest with KMS and in transit with HTTPS/SSH
  • You can create Notification Rules (on commits, merges, pull requests, branches). It creates an SNS topic.

CodePipeline

  • Continuous Delivery – CD
  • Automates build, test and deploy phases. Has direct integration with Beanstalk
  • Visual workflow to orchestrate
  • It contains stages like Build->Test->Deploy
  • Each stage can create artifacts, and place them in S3 buckets, to be used in later stages.
  • Create Cloudwatch events for failures etc
  • When you create a CodePipeline you need to define
    • Artifact store (default S3 or a different S3)
    • Source provider (CodeCommit, Github, S3)
      • Detect changes with CloudWatch Events(Recommended) or CodePipeline
    • Build provider (CodeBuild or Jenkins)
    • Deploy provider (Beanstalk, CodeDeploy, Cloudformation, ECS, S3..)
  • Stages have multiple action groups. We can add sequential or parallel actions on a stage

CodeBuild

  • Continuous Integration – CI 
  • Uses Docker in the backend to create a test environment
  • buildspec.yml 
    • env
      • variables
      • parameter-store
      • secrets-manager
    • phases
      • install
      • pre_build
      • build
      • post_build
    • artifacts
    • cache
  • Good practice: Cache some files on S3 for performance
  • Stores logs on s3
  • By default, it runs outside of VPC. You can configure it to access resources from the VPC.

 

CodeDeploy

  • The server must be running the CodeDeploy Agent. The agent is polling CodeDeploy for changes
  • appspec.yml is Located on the root directory
  • Can deploy software packages using an archive that has been uploaded to an Amazon S3 bucket.
  • Rollbacks can be Automatic or Manual
    • CodeDeploy redeploys the last known good revision as a new deployment
  • Lifecycle Events
    • ApplicationStop
    • DownloadBundle
    • BeforeInstall
    • Install
    • AfterInstall
    • ApplicationStart
    • ValidateService
    • BeforeBlockService
    • BlockTraffic
    • AfterBlockTraffic
    • BeforeAllowTraffic
    • AllowTraffic

CodeDeploy Components

  • Application
  • Compute Platform
  • Deployment Configuration
    • One at a Time
    • Half at a time
    • All at once
    • Custom
  • Deployment Group
  • Deployment Type
    • In place (small downtime)
    • Blue/green
      • For Lambda and ECS, Blue/Green is the only option
  • IAM Instance Profile
  • Application Revision
  • Service Role
  • Target Revision

CodeStar

  • An integrated solution of all the CI/CD tools. Orchestrates everything. 
  • Issue tracking integration with Jira
  • Free service
  • You can choose a platform/language. Also, you can add team members.
  • In the IDE tab, you can set up a Cloud9 or an IDE of your choice

CodeGuru

  • Static code analysis 
  • Machine Learning for code reviews and performance recommendation
  • Supports Java and Python
  • CodeGuru Profile: understands runtime behavior on production