2.141.0-alpha.0 • Published 3 days ago

@aws-cdk/cli-lib-alpha v2.141.0-alpha.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
3 days ago

AWS CDK CLI Library


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.


⚠️ Experimental module

This package is highly experimental. Expect frequent API changes and incomplete features. Known issues include:

  • JavaScript/TypeScript only\ The jsii packages are currently not in a working state.
  • No useful return values\ All output is currently printed to stdout/stderr
  • Missing or Broken options\ Some CLI options might not be available in this package or broken

Overview

Provides a library to interact with the AWS CDK CLI programmatically from jsii supported languages. Currently the package includes implementations for:

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

Setup

AWS CDK app directory

Obtain an AwsCdkCli class from an AWS CDK app directory (containing a cdk.json file):

const cli = AwsCdkCli.fromCdkAppDirectory("/path/to/cdk/app");

Cloud Assembly Directory Producer

You can also create AwsCdkCli from a class implementing ICloudAssemblyDirectoryProducer. AWS CDK apps might need to be synthesized multiple times with additional context values before they are ready.

The produce() method of the ICloudAssemblyDirectoryProducer interface provides this multi-pass ability. It is invoked with the context values of the current iteration and should use these values to synthesize a Cloud Assembly. The return value is the path to the assembly directory.

A basic implementation would look like this:

class MyProducer implements ICloudAssemblyDirectoryProducer {
  async produce(context: Record<string, any>) {
    const app = new cdk.App({ context });
    const stack = new cdk.Stack(app);
    return app.synth().directory;
  }
}

For all features (e.g. lookups) to work correctly, cdk.App() must be instantiated with the received context values. Since it is not possible to update the context of an app, it must be created as part of the produce() method.

The producer can than be used like this:

const cli = AwsCdkCli.fromCloudAssemblyDirectoryProducer(new MyProducer());

Commands

list

// await this asynchronous method call using a language feature
cli.list();

synth

// await this asynchronous method call using a language feature
cli.synth({
  stacks: ['MyTestStack'],
});

bootstrap

// await this asynchronous method call using a language feature
cli.bootstrap();

deploy

// await this asynchronous method call using a language feature
cli.deploy({
  stacks: ['MyTestStack'],
});

destroy

// await this asynchronous method call using a language feature
cli.destroy({
  stacks: ['MyTestStack'],
});
2.141.0-alpha.0

3 days ago

2.140.0-alpha.0

10 days ago

2.139.1-alpha.0

12 days ago

2.139.0-alpha.0

17 days ago

2.138.0-alpha.0

23 days ago

2.137.0-alpha.0

1 month ago

2.136.1-alpha.0

1 month ago

2.136.0-alpha.0

1 month ago

2.135.0-alpha.0

1 month ago

2.134.0-alpha.0

2 months ago

2.133.0-alpha.0

2 months ago

2.132.1-alpha.0

2 months ago

2.132.0-alpha.0

2 months ago

2.131.0-alpha.0

2 months ago

2.129.0-alpha.0

3 months ago

2.130.0-alpha.0

3 months ago

2.128.0-alpha.0

3 months ago

2.127.0-alpha.0

3 months ago

2.126.0-alpha.0

3 months ago

2.125.0-alpha.0

3 months ago

2.124.0-alpha.0

4 months ago

2.123.0-alpha.0

4 months ago

2.122.0-alpha.0

4 months ago

2.121.0-alpha.0

4 months ago

2.120.0-alpha.0

4 months ago

2.121.1-alpha.0

4 months ago

2.119.0-alpha.0

4 months ago

2.118.0-alpha.0

4 months ago

2.117.0-alpha.0

5 months ago

2.116.1-alpha.0

5 months ago

2.116.0-alpha.0

5 months ago

2.115.0-alpha.0

5 months ago

2.114.1-alpha.0

5 months ago

2.114.0-alpha.0

5 months ago

2.113.0-alpha.0

5 months ago

2.111.0-alpha.0

6 months ago

2.112.0-alpha.0

5 months ago

2.108.1-alpha.0

6 months ago

2.107.0-alpha.0

6 months ago

2.109.0-alpha.0

6 months ago

2.106.0-alpha.0

6 months ago

2.110.0-alpha.0

6 months ago

2.105.0-alpha.0

6 months ago

2.108.0-alpha.0

6 months ago

2.106.1-alpha.0

6 months ago

2.110.1-alpha.0

6 months ago

2.103.0-alpha.0

7 months ago

2.103.1-alpha.0

7 months ago

2.102.1-alpha.0

7 months ago

2.104.0-alpha.0

6 months ago

2.100.0-alpha.0

7 months ago

2.94.0-alpha.0

8 months ago

2.88.0-alpha.0

10 months ago

2.101.1-alpha.0

7 months ago

2.99.1-alpha.0

7 months ago

2.95.1-alpha.0

8 months ago

2.97.0-alpha.0

8 months ago

2.90.0-alpha.0

9 months ago

2.102.0-alpha.0

7 months ago

2.87.0-alpha.0

10 months ago

2.91.0-alpha.0

9 months ago

2.96.1-alpha.0

8 months ago

2.98.0-alpha.0

8 months ago

2.92.0-alpha.0

9 months ago

2.86.0-alpha.0

11 months ago

2.89.0-alpha.0

10 months ago

2.95.0-alpha.0

8 months ago

2.99.0-alpha.0

8 months ago

2.97.1-alpha.0

8 months ago

2.96.2-alpha.0

8 months ago

2.101.0-alpha.0

7 months ago

2.93.0-alpha.0

9 months ago

2.96.0-alpha.0

8 months ago

2.82.0-alpha.0

12 months ago

2.84.0-alpha.0

11 months ago

2.85.0-alpha.0

11 months ago

2.83.0-alpha.0

11 months ago

2.83.1-alpha.0

11 months ago

2.78.0-alpha.0

1 year ago

2.81.0-alpha.0

12 months ago

2.76.0-alpha.0

1 year ago

2.75.0-alpha.0

1 year ago

2.77.0-alpha.0

1 year ago

2.74.0-alpha.0

1 year ago

2.75.1-alpha.0

1 year ago

2.80.0-alpha.0

12 months ago

2.79.1-alpha.0

1 year ago

2.79.0-alpha.0

1 year ago

2.73.0-alpha.0

1 year ago

2.65.0-alpha.0

1 year ago

2.72.0-alpha.0

1 year ago

2.63.2-alpha.0

1 year ago

2.72.1-alpha.0

1 year ago

2.69.0-alpha.0

1 year ago

2.70.0-alpha.0

1 year ago

2.68.0-alpha.0

1 year ago

2.71.0-alpha.0

1 year ago

2.64.0-alpha.0

1 year ago

2.63.1-alpha.0

1 year ago

2.67.0-alpha.0

1 year ago

2.66.1-alpha.0

1 year ago

2.66.0-alpha.0

1 year ago

2.63.0-alpha.0

1 year ago

2.62.2-alpha.0

1 year ago

2.62.1-alpha.0

1 year ago

2.62.0-alpha.0

1 year ago

2.61.1-alpha.0

1 year ago

2.61.0-alpha.0

1 year ago