Skip to content

Files

cdk-cli-wrapper

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Feb 19, 2025
Feb 28, 2025
Feb 19, 2025
Feb 17, 2025
Mar 6, 2025
Feb 17, 2025
Feb 20, 2025
Feb 25, 2025
Feb 17, 2025
Feb 17, 2025
Feb 17, 2025
Feb 17, 2025
Feb 17, 2025
Feb 20, 2025
Mar 3, 2025
Feb 17, 2025
Feb 17, 2025

cdk-cli-wrapper


cdk-constructs: Experimental

The APIs of higher level constructs in this module are experimental and under active development. They are subject to non-backward compatible changes or removal in any future version. These are not subject to the Semantic Versioning model and breaking changes will be announced in the release notes. This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package.


CDK CLI Wrapper Library.

Internal only for now.

Overview

This package provides a library which wraps the CDK CLI, allowing you to interact with the CLI programmatically.

Currently this package provides wrappers for:

  • cdk deploy
  • cdk synth
  • cdk destroy
  • cdk list

Usage

First create a new CdkCliWrapper with the directory in which you want to execute commands, and optionally any environment variables that you want to include in the execution environment.

new CdkCliWrapper({
  directory: '/path/to/project',
  env: {
    KEY: 'value',
  },
});

deploy

const cdk = new CdkCliWrapper({
  directory: '/project/path',
});

cdk.deploy({
  app: 'node bin/my-app.js',
  stacks: ['my-test-stack'],
});

synth

const cdk = new CdkCliWrapper({
  directory: '/project/path',
});

cdk.synth({
  app: 'node bin/my-app.js',
  stacks: ['my-test-stack'],
});

destroy

const cdk = new CdkCliWrapper({
  directory: '/project/path',
});

cdk.destroy({
  app: 'node bin/my-app.js',
  stacks: ['my-test-stack'],
});

list

const cdk = new CdkCliWrapper({
  directory: '/project/path',
});

cdk.list({
  app: 'node bin/my-app.js',
  stacks: ['*'],
});