Building pipelines with CodePipeline

Automating Deployments on AWS

Dunieski Otano

Amazon Web Services Solutions Architect

Multi-stage pipelines

video2-preview-multi-stage-pipeline-with-artifacts-approval-eventbridge.png

Automating Deployments on AWS

Anatomy of a CodePipeline pipeline

  • A pipeline is a sequence of stages
  • Each stage contains action groups with actions
  • Actions produce and consume artifacts (stored in S3)
  • The next stage consumes artifacts as input

codepipeline-anatomy-stages-actions-artifacts.png

Automating Deployments on AWS

Connecting source, build, and deploy

  • Source stage: CodeCommit detects a push, outputs source artifact
  • Build stage: CodeBuild receives source, outputs build artifact
  • Deploy stage: CodeDeploy receives build artifact, deploys to target
  • Pipeline runs end-to-end on every code push

3-stage-pipeline

Automating Deployments on AWS

Manual approval actions

  • Manual approval: Human gate between stages
  • Pipeline pauses until someone approves or rejects
  • Common use: gate between staging and production
  • Status shows "Waiting for approval"; supports SNS notifications

manual-approval-gate-team-lead-reviewing-pipeline.png

Automating Deployments on AWS

Stage transitions and pipeline control

  • Enable/disable transitions between stages
    • Disable to pause the pipeline at a specific point
  • Retry failed actions without restarting the pipeline
  • Release change manually to push a specific revision

 

codepipeline-stage-transition-controls-retry-release.png

Automating Deployments on AWS

Pipeline event notifications

codepipeline-anatomy-stages-actions-artifacts.png

  • CodePipeline sends events to Amazon EventBridge
  • Events include: pipeline started, stage succeeded, stage failed
  • Create EventBridge rules to route events to targets
    • SNS topics for email/SMS alerts
    • Lambda functions for custom automation
  • Event detail includes pipeline name, stage name, and failure reason
Automating Deployments on AWS

Multi-environment pipeline design

  • Single pipeline deploys to multiple environments
  • Build once, then promote: Dev -> Staging -> Approval -> Prod
  • Same artifact flows through every environment
  • What you tested is exactly what you deploy

multi-environment-pipeline-dev-staging-approval-prod.png

Automating Deployments on AWS

Let's practice!

Automating Deployments on AWS

Preparing Video For Download...