Skip to main content

CDK CI/CD Wrapper

License

The CDK CI/CD Wrapper is a comprehensive solution that streamlines the delivery of your AWS Cloud Development Kit (CDK) applications. It provides a robust and standardized multi-stage CI/CD pipeline, ensuring high quality and confidence throughout the development and deployment process.

Table of Contents

Introduction

The CDK CI/CD Wrapper builds upon the success of the aws-cdk-cicd-boot-sample and takes it a step further by providing additional tools and features to simplify and standardize the multi-stage CI/CD process for your Infrastructure as Code (IaC) projects.

Features

  • CodeBuild in a VPC, in a private VPC with a NAT gateway, or behind an HTTP proxy.
  • Dependency and code security scanning (npm audit, pip-audit, Bandit, Semgrep, ShellCheck) and open-source license checks over npm and Python dependencies.
  • A private npm registry or CodeArtifact for your own packages.
  • Default-on security hardening (cdk-nag and hardening aspects) applied to every stack.
  • TypeScript and JavaScript CDK apps run the pipeline through cdk-cicd exec; Python, Java and .NET apps can apply the security plugins with CdkCicd.attach.

Getting Started

Prerequisites

Before you begin, ensure that you have the following dependencies installed:

  • AWS Account (RES/DEV/INT/PROD)
  • macOS or Cloud9 with Ubuntu Server 22.04 LTS Platform in the RES Account
  • Bash/ZSH terminal
  • Docker version >= 24.0.x
  • AWS CLI v2 (installation guide)
  • AWS credentials and profiles for each environment in ~/.aws/config (configuration guide)
  • Node.js >= 20.19.0
  • jq command-line JSON processor (jq-1.7)

For developing Python Lambdas, you'll also need:

Installation

In your CDK app, install the library and the CLI, then let init write cicd.config.ts and point cdk.json at cdk-cicd exec:

npm i @cdklabs/cdk-cicd-wrapper @cdklabs/cdk-cicd-wrapper-cli
npx cdk-cicd init

The Getting Started guide covers the next steps: bootstrapping, cdk-cicd deploy-ci and the first push.

Usage

Defining Stages

List the stages in cicd.config.ts, in deployment order: stages: ['dev', 'prod']. dev and res deploy without approval; every other stage waits for a manual approval by default. A stage can also name its own account and Regions: { name: 'prod', env: { account: '111111111111', region: 'eu-west-1' } }.

Configuring Stacks

Configure the CDK stacks you want to deploy in each stage. The CDK CI/CD Wrapper allows you to specify which stacks should be deployed in each stage, giving you granular control over your deployment process.

Customizing CI/CD Steps

With no ci.steps, the Build runs npm ci, then your project's npm run audit, build and test, each only when the script exists. Set ci.steps in cicd.config.ts to replace those commands; the synth step is always added. See the CI guide.

Autopilot Deployment Contracts

Area Contract
APP_STAGING Valid for direct/local cdk deploy (including local cdk-cicd deploy --from-image) and Repo 1 container-image synthesis. Wrapper-generated deployment pipelines—flat CODEPIPELINE, Repo 2, CDK_PIPELINES, and GITHUB_ACTIONS—reject it. On direct/local paths, custom deploy and CloudFormation execution roles govern application stacks; staging support resources use caller/base credentials.
Deploy-role ExternalId CDK_PIPELINES and GITHUB_ACTIONS reject configured deploy-role ExternalIds rather than silently dropping them. APP_STAGING accepts custom deployment identities but rejects a deploy-role ExternalId because the alpha API does not expose one.
CloudFormation execution role CodeBuild assumes the deployment role; that assumed role passes the configured CloudFormation execution role to CloudFormation. Grant iam:PassRole to the deployment role, not directly to the CodeBuild project role.
Custom CodeBuild ECR image A private ECR environment image must be in the CodeBuild project's Region; flat CodePipeline and CDK Pipelines also require the pipeline account. Repo 2 supports its explicit cross-account image path only after the owner-side repository policy is configured and crossAccountEcrRepositoryPolicyConfigured is acknowledged; the build-image Region rule still applies.
GitHub manual approval Configure required reviewers on each generated GitHub Environment, then set githubActions.environmentProtectionConfigured: true. Referencing an environment in workflow YAML does not configure its protection rules.

Contributing

Contributions to the CDK CI/CD Wrapper are welcome! If you'd like to contribute, please follow the guidelines outlined in the CONTRIBUTING.md file.

License

This project is licensed under the Apache 2.0 License.

Metadata

Release files for cdklabs.cdk-cicd-wrapper 2.7.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cdklabs.cdk-cicd-wrapper 2.7.1
File Size Uploaded Provenance Actions
cdklabs_cdk_cicd_wrapper-2.7.1.tar.gz 1.0 MB With provenance Details for cdklabs_cdk_cicd_wrapper-2.7.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cdklabs.cdk-cicd-wrapper 2.7.1
File Interpreter ABI Platform Actions
cdklabs_cdk_cicd_wrapper-2.7.1-py3-none-any.whl Python 3 none any Details for cdklabs_cdk_cicd_wrapper-2.7.1-py3-none-any.whl

Total release size: 2.1 MB

Release files / cdklabs_cdk_cicd_wrapper-2.7.1.tar.gz

Download URL cdklabs_cdk_cicd_wrapper-2.7.1.tar.gz
Size 1.0 MB
Tags Source
SHA-256 checksum
How to use checksums
cf51cf6f280a2f0aa87efa4072225f8d117562ac8c3ff9c09c04751c01c6407f
BLAKE2b-256 checksum
How to use checksums
773dc0807e22193572637471e940ba6d89165220853beb6b4e0adc3d71f93696
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.15.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Release files / cdklabs_cdk_cicd_wrapper-2.7.1-py3-none-any.whl

Download URL cdklabs_cdk_cicd_wrapper-2.7.1-py3-none-any.whl
Size 1.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
8371334d81690d4d4e091c79f92679e71afe4acead43beeaaf866c5435f5eccd
BLAKE2b-256 checksum
How to use checksums
db4f35b57e833ab5307c11be29167e59d0e5cd85895656b7f8ecc95ad84b4e1a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.15.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Security for cdklabs.cdk-cicd-wrapper 2.7.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for cdklabs_cdk_cicd_wrapper-2.7.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.7.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page