@cdklabs/cdk-cicd-wrapper

中文文档
2.4.2发布于 2026/11/09Apache-2.0TypeScriptCommonJS构建来源已验证近 30 天下载 3648

This repository contains the infrastructure as code to wrap your AWS CDK project with CI/CD around it.

原始使用文档
文档目录14 节
  1. CDK CI/CD Wrapper
  2. Table of Contents
  3. Introduction
  4. Features
  5. Getting Started
  6. Prerequisites
  7. Installation
  8. Usage
  9. Defining Stages
  10. Configuring Stacks
  11. Customizing CI/CD Steps
  12. Autopilot Deployment Contracts
  13. Contributing
  14. License

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

  • Multi-staged CI/CD Pipeline: Seamlessly deploy your CDK applications across multiple stages (e.g., DEV, INT, PROD) and AWS accounts.
  • Security Scanning: Perform security scanning on dependencies and codebase, blocking the pipeline in case of CVE findings.
  • License Management: Manage licenses for NPM and Python dependencies, ensuring compliance with your organization's policies.
  • Private NPM Registry: Securely store and utilize private NPM libraries.
  • Customizable Pipeline: Tailor the CI/CD pipeline to your project's specific needs with built-in dependency injection.
  • Workbench Deployment: Develop and experiment with your solutions in isolation before introducing them to the delivery pipeline.
  • Pre/Post Deploy Hooks: Execute custom scripts before and after deployments in each stage (e.g., unit tests, functional tests, load testing).
  • Centralized Compliance Logs: Store compliance logs in pre-configured S3 buckets on a per-stage/environment basis.
  • Lambda Layer Support: Build and scan dependencies for Python Lambda Layers.

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 >= v18.17._ && NPM >= v10.2._
  • jq command-line JSON processor (jq-1.7)

For developing Python Lambdas, you'll also need:

Installation

  1. Clone the CDK CI/CD Wrapper repository:

    git clone https://github.com/your-repo/cdk-cicd-wrapper.git
    cd cdk-cicd-wrapper
    
  2. Install the required dependencies:

    npm install
    

Usage

Defining Stages

The CDK CI/CD Wrapper comes with a default set of stages (DEV, INT, PROD), but you can easily extend or modify these stages to suit your project's needs. Follow the step-by-step guide in the documentation to define your desired stages.

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

Tailor the CI/CD pipeline to meet your project's specific requirements. The CDK CI/CD Wrapper provides built-in dependency injection, allowing you to customize the CI/CD steps seamlessly.

Autopilot Deployment Contracts

AreaContract
APP_STAGINGValid 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 ExternalIdCDK_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 roleCodeBuild 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 imageA 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 approvalConfigure 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.

版本与发布记录

@cdklabs/cdk-cicd-wrapper 共发布 80 个版本,首次发布于 2024/05/07;过去 12 个月发布了 36 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
2.4.2latest2026/11/09今天
2.4.12026/11/09今天
2.4.02026/11/062 天前
2.3.72026/10/1921 天前
2.3.62026/10/1327 天前
2.3.52026/10/051 个月前

关于 @cdklabs/cdk-cicd-wrapper 的常见问题

@cdklabs/cdk-cicd-wrapper 是什么?

This repository contains the infrastructure as code to wrap your AWS CDK project with CI/CD around it.

如何安装 @cdklabs/cdk-cicd-wrapper?

在项目目录运行 npm install @cdklabs/cdk-cicd-wrapper,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:cdk-nag(^2.37.55)、constructs(^10.8.1)、aws-cdk-lib(^2.195.0)、cdk-pipelines-github(^0.4.132)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@cdklabs/cdk-cicd-wrapper 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@cdklabs/cdk-cicd-wrapper 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@cdklabs/cdk-cicd-wrapper 可以商用吗?

@cdklabs/cdk-cicd-wrapper 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@cdklabs/cdk-cicd-wrapper 的下载量有多少?

根据 npm 官方下载统计,@cdklabs/cdk-cicd-wrapper 在 2026/10/10 – 2026/11/08 这 30 天内被下载 3,648 次,日均约 122 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@cdklabs/cdk-cicd-wrapper 还在维护吗?

最新版本 2.4.2 发布于 2026/11/09(今天);至今共发布 80 个版本,其中过去 12 个月发布了 36 个;首次发布于 2024/05/07。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。