Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/okruti-raghuraj/aws-1/llms.txt

Use this file to discover all available pages before exploring further.

The AWS CDK Pipeline project is a TypeScript-based AWS Cloud Development Kit (CDK) application that provisions a fully self-mutating CI/CD pipeline using AWS CodePipeline and the CDK Pipelines construct library. Rather than manually managing pipeline infrastructure, this project lets the pipeline update itself whenever your CDK code changes — keeping your delivery infrastructure in sync with your application code at all times.

What is AWS CDK Pipeline?

AWS CDK Pipeline is built on top of the CDK Pipelines higher-level construct library, which is included in aws-cdk-lib. CDK Pipelines wraps AWS CodePipeline to provide a purpose-built, opinionated way to deliver CDK applications continuously. The central concept is self-mutation: when you push a change to your repository, the pipeline first synthesizes the CDK app, then updates its own CloudFormation stack before continuing to any application stages. This means the pipeline always reflects the latest version of your infrastructure code — no manual pipeline updates required. The flow works as follows:
  1. A developer pushes code to the GitHub source branch.
  2. CodePipeline detects the change and triggers a synth step (npm ci, npm run build, npx cdk synth).
  3. The CDK Pipelines library compares the synthesized template against the deployed pipeline stack and self-mutates if there are differences.
  4. Subsequent stages deploy your application stacks to target AWS environments.
The pipeline stack itself (AwsCdkPipelineStack) is a standard CDK Stack that creates a CodePipeline construct backed by a GitHub source connection, so the entire pipeline definition lives in version-controlled TypeScript.

Key Features

Self-Mutating Pipeline

The pipeline updates its own infrastructure on every commit. Push a change to your CDK code and the pipeline automatically upgrades itself before deploying anything else — no out-of-band manual updates needed.

GitHub Source Integration

Source is pulled directly from a GitHub repository and branch via CodePipelineSource.gitHub(). The pipeline triggers automatically on new commits to the configured branch.

TypeScript CDK Constructs

All infrastructure is defined in TypeScript using aws-cdk-lib 2.20.0 and the constructs library. Strong typing catches configuration errors at compile time, before anything is deployed.

Multi-Stage Deployment

CDK Pipelines supports adding multiple Stage instances to the pipeline, enabling promotion across environments (e.g., dev → staging → production) with optional manual approval gates between stages.

Extensible Lambda Scaffold

The project includes commented-out scaffold files — lib/aws-cdk-pipeline-lambda-stack.ts and lib/my-pipeline-app-stage.ts — showing the pattern for wiring a Lambda stack into a CDK Stage. Uncomment and extend them to add your own Lambda-based workloads.

CDK Context Feature Flags

cdk.json ships with a curated set of CDK context feature flags — covering API Gateway, RDS, Lambda, CloudFront, IAM, EC2, and ECS — so the project defaults to current best-practice behaviour from day one.

Project Structure

The repository follows the standard CDK TypeScript project layout:
aws-cdk-pipeline/
├── bin/
│   └── aws-cdk-pipeline.ts        # CDK app entry point; defines env (account/region)
├── lib/
│   ├── aws-cdk-pipeline-stack.ts  # Main pipeline stack (CodePipeline + ShellStep synth)
│   ├── aws-cdk-pipeline-lambda-stack.ts  # Commented-out Lambda stack scaffold
│   └── my-pipeline-app-stage.ts   # Commented-out CDK Stage scaffold
├── test/
│   └── aws-cdk-pipeline.test.ts   # Jest unit tests
├── cdk.json                       # CDK toolkit config and context feature flags
├── package.json                   # Node dependencies and npm scripts
└── tsconfig.json                  # TypeScript compiler configuration
The bin/ entry point instantiates AwsCdkPipelineStack with a hard-coded env block specifying the target AWS account and region. The lib/ directory contains the active pipeline stack definition alongside two commented-out scaffold files for Lambda and Stage constructs. Tests live under test/ and are run with Jest via npm test.

When to Use This Project

This project is designed as a starting-point template for teams that want a self-mutating CDK pipeline without building one from scratch. Clone it, point the GitHub source at your own repository, update the AWS environment values, and you have a production-ready pipeline skeleton ready to extend with your own application stages.

Build docs developers (and LLMs) love