Skip to content

Container delivery pipeline on AWS

A GitHub push runs through AWS CodePipeline: CodeBuild pushes the image to ECR, CodeDeploy releases to staging, an SNS approval gate holds production, and CloudWatch alarms let CodeDeploy roll back.

aws10 nodes3 groups10 edges
Edit in the playgroundOpen full size
AWS CodePipeline with CodeBuild, ECR, CodeDeploy to staging and production ECS on Fargate, an SNS approval gate and CloudWatch alarmsAWS CodePipeline with CodeBuild, ECR, CodeDeploy to staging and production ECS on Fargate, an SNS approval gate and CloudWatch alarmsAWS CodePipeline with CodeBuild, ECR, CodeDeploy to staging and production ECS on Fargate, an SNS approval gate and CloudWatch alarmsAWS CodePipeline with CodeBuild, ECR, CodeDeploy to staging and production ECS on Fargate, an SNS approval gate and CloudWatch alarms
aws-codepipeline-cicd.yamlOn GitHub
# yaml-language-server: $schema=../references/diagram.schema.json
title: Container delivery pipeline on AWS
subtitle: AWS CodePipeline builds each push from GitHub, deploys it to staging, waits for approval and releases it to production on Amazon Elastic Container Service
direction: down

legend:
  solid: Release path
  dashed: Monitoring

groups:
  cloud: { type: aws:cloud }
  region: { type: aws:region, label: us-east-1, in: cloud }
  pipeline: { type: aws:generic, label: AWS CodePipeline, in: region }

nodes:
  dev: { icon: aws:user, label: Developer, note: git push }
  # GitHub sits outside AWS; the pipeline reads it through an AWS CodeConnections connection.
  github: { icon: aws:git-repository, label: GitHub, note: AWS CodeConnections }
  build: { icon: aws:codebuild, label: AWS CodeBuild, note: Build and test, in: pipeline }
  deploy-stg: { icon: aws:codedeploy, label: AWS CodeDeploy, note: Deploy to staging, in: pipeline }
  approval: { icon: aws:sns, label: Amazon Simple Notification Service, note: Approval gate, in: pipeline }
  deploy-prd: { icon: aws:codedeploy, label: AWS CodeDeploy, note: Deploy to production, in: pipeline }
  ecr: { icon: aws:ecr, label: Amazon Elastic Container Registry, note: Image registry, in: region }
  ecs-stg: { icon: aws:ecs, label: Amazon ECS, note: Staging service on AWS Fargate, in: region }
  ecs-prd: { icon: aws:ecs, label: Amazon ECS, note: Production service on AWS Fargate, in: region }
  cw: { icon: aws:cloudwatch, label: Amazon CloudWatch, note: Logs and alarms, in: region }

edges:
  # constraint: false keeps the developer beside the repository and the four stages in one row.
  - { from: dev, to: github, constraint: false }
  - github -> pipeline: { label: source }
  - { from: build, to: deploy-stg, constraint: false }
  - { from: deploy-stg, to: approval, constraint: false }
  - { from: approval, to: deploy-prd, constraint: false }
  # Each stage hangs its target directly below it.
  - build -> ecr: { label: push image }
  - deploy-stg -> ecs-stg: { label: deploy }
  - deploy-prd -> ecs-prd: { label: deploy }
  # CodeDeploy watches the CloudWatch alarms and rolls back a failing release.
  - deploy-prd --> cw: alarms
  - ecs-prd --> cw: metrics

Start from this one

Copies the spec to diagram.yaml, then renders every format.

$ orrery init aws-codepipeline-cicd$ orrery render diagram.yaml -f all --theme both