CI/CD Pipeline (CDK Pipelines)

intermediate

Self-mutating CDK Pipeline connected to a GitHub repository via CodeStar Connection. Deploys through Staging and Production stages with manual approval and a smoke test step.

Quick Start

Via CLI (recommended)

npx cdk-starter create

Then select "CI/CD Pipeline (CDK Pipelines)" from the prompt

Or scaffold directly

npx cdk-starter create --starter cicd-pipeline

README

CI/CD Pipeline (CDK Pipelines)

Self-mutating CDK Pipeline connected to GitHub via AWS CodeStar Connections. Deploys through Staging and Production stages with manual approval.

Setup

  1. Create a GitHub connection in the AWS Console: https://console.aws.amazon.com/codesuite/settings/connections

  2. Set environment variables:

export GITHUB_CONNECTION_ARN=arn:aws:codestar-connections:...
export GITHUB_OWNER=your-github-org
export GITHUB_REPO=your-repo-name
  1. Replace lib/stages/app-stage.ts with your real application stacks.

  2. Deploy the pipeline (only needed once — it self-updates after that):

npx cdk deploy

Prerequisites

  • Node.js ≥ 20
  • AWS CLI configured (aws configure)
  • CDK bootstrapped (npx cdk bootstrap)

Deploy

npm install
npx cdk diff
npx cdk deploy

Tear down

npx cdk destroy