โ˜๏ธAWSDVA Prep
← All cheat sheets
๐Ÿš€

CI/CD: CodePipeline, CodeBuild, CodeDeploy

Deployment

AWS-native continuous integration and delivery toolchain.

CodePipeline

  • โ–ธOrchestrates stages (Source โ†’ Build โ†’ Test โ†’ Deploy) with parallel/sequential actions.
  • โ–ธArtifacts flow between stages via an S3 artifact bucket.
  • โ–ธCan trigger on source changes (CodeCommit/GitHub/S3) via EventBridge or webhooks.

CodeBuild

  • โ–ธbuildspec.yml defines phases: install, pre_build, build, post_build, and artifacts.
  • โ–ธRuns in managed, ephemeral build containers; supports custom Docker images.

CodeDeploy

  • โ–ธappspec.yml defines files to copy and lifecycle hooks (BeforeInstall, AfterInstall, ApplicationStart, ValidateService, etc.).
  • โ–ธIn-place deployment: updates existing instances directly.
  • โ–ธBlue/green deployment: new environment provisioned, traffic shifted, old environment kept for rollback.
  • โ–ธAlso deploys to Lambda (canary/linear traffic shifting via alias) and ECS (blue/green via target groups).

CloudFormation & SAM

  • โ–ธChange sets preview updates before execution โ€” catches unwanted resource replacement.
  • โ–ธNested stacks modularize reusable templates.
  • โ–ธSAM adds shorthand serverless resources (Function, Api, SimpleTable); sam build + sam deploy package and transform to CloudFormation.
Test yourself on this โ†’