CodePipeline Stages
- Source → Build → Test → Deploy → Approval → Invoke
- Actions run in parallel within a stage; stages are sequential
- Cross-account: use IAM roles and KMS CMK for artifact encryption
- S3 artifact store shared across pipeline accounts
CodeBuild (buildspec.yml)
- Phases: install → pre_build → build → post_build
- Artifacts: files, base-directory, discard-paths
- Cache: S3 or local caching for dependencies
- Reports: test reports in JUnit XML or Cucumber JSON
CodeDeploy
- EC2: in-place or blue/green via appspec.yml hooks
- Lambda: AllAtOnce, Canary10Percent5Minutes, Linear10PercentEvery1Minute
- ECS: blue/green with target group switching
- Rollback: automatic on deployment failure or alarm breach
Best Practices
- Use CodePipeline triggers (EventBridge) instead of polling
- Encrypt artifacts with CMK for cross-account access
- Implement manual approval gates for production
- Use CodeBuild batch builds for parallel test suites
Practice CI/CD Pipelines Questions
Put your knowledge to the test with practice questions.