Skip to content

Commit 0a0aebd

Browse files
committed
Update: Add developer preview docs for CDK Toolkit Library
1 parent c945be3 commit 0a0aebd

File tree

4 files changed

+35
-6
lines changed

4 files changed

+35
-6
lines changed

v2/cli.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ The CDK CLI actually runs your app and synthesizes fresh templates before most o
289289

290290
See `cdk synth --help` for all available options\. A few of the most frequently used options are covered in the following section\.
291291

292-
### Specify context values<a name="w94aac69c33c11"></a>
292+
### Specify context values<a name="w94aac73c33c11"></a>
293293

294294
Use the `--context` or `-c` option to pass [runtime context](context.md) values to your CDK app\.
295295

@@ -308,15 +308,15 @@ When deploying multiple stacks, the specified context values are normally passed
308308
cdk synth --context Stack1:key=value Stack2:key=value Stack1 Stack2
309309
```
310310

311-
### Specify display format<a name="w94aac69c33c13"></a>
311+
### Specify display format<a name="w94aac73c33c13"></a>
312312

313313
By default, the synthesized template is displayed in YAML format\. Add the `--json` flag to display it in JSON format instead\.
314314

315315
```
316316
cdk synth --json MyStack
317317
```
318318

319-
### Specify the output directory<a name="w94aac69c33c15"></a>
319+
### Specify the output directory<a name="w94aac73c33c15"></a>
320320

321321
Add the `--output` \(`-o`\) option to write the synthesized templates to a directory other than `cdk.out`\.
322322

@@ -392,7 +392,7 @@ Git\-style wildcards, both `*` and `**`, can be used in the `"watch"` and `"buil
392392
**Important**
393393
Watch mode is not recommended for production deployments\.
394394

395-
### Specify AWS CloudFormation parameters<a name="w94aac69c35c19"></a>
395+
### Specify AWS CloudFormation parameters<a name="w94aac73c35c19"></a>
396396

397397
The CDK CLI supports specifying AWS CloudFormation [parameters](parameters.md) at deployment\. You may provide these on the command line following the `--parameters` flag\.
398398

@@ -414,7 +414,7 @@ cdk deploy MyStack YourStack --parameters MyStack:uploadBucketName=UploadBucket
414414

415415
By default, the AWS CDK retains values of parameters from previous deployments and uses them in later deployments if they are not specified explicitly\. Use the `--no-previous-parameters` flag to require all parameters to be specified\.
416416

417-
### Specify outputs file<a name="w94aac69c35c21"></a>
417+
### Specify outputs file<a name="w94aac73c35c21"></a>
418418

419419
If your stack declares AWS CloudFormation outputs, these are normally displayed on the screen at the conclusion of deployment\. To write them to a file in JSON format, use the `--outputs-file` flag\.
420420

v2/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ sponsored by Amazon.
7474
+ [AWS CDK policy validation at synthesis time](policy-validation-synthesis.md)
7575
+ [Continuous integration and delivery (CI/CD) using CDK Pipelines](cdk_pipeline.md)
7676
+ [Troubleshoot AWS CDK deployments](deploy-troubleshoot.md)
77+
+ [Perform programmatic actions using the CDK Toolkit Library](toolkit-library.md)
7778
+ [Test AWS CDK applications](testing.md)
7879
+ [Locally test and build AWS CDK applications with the AWS SAM CLI](testing-locally.md)
7980
+ [Getting started with locally testing](testing-locally-getting-started.md)

v2/serverless_example.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1494,7 +1494,7 @@ CdkHelloWorldStack: destroying... [1/1]
14941494

14951495
## Troubleshooting<a name="serverless-example-troubleshooting"></a>
14961496

1497-
### Error: \{“message”: “Internal server error”\}%<a name="w94aac81c11c55b5"></a>
1497+
### Error: \{“message”: “Internal server error”\}%<a name="w94aac85c11c55b5"></a>
14981498

14991499
When invoking the deployed Lambda function, you receive this error\. This error could occur for multiple reasons\.
15001500

v2/toolkit-library.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Perform programmatic actions using the CDK Toolkit Library<a name="toolkit-library"></a>
2+
3+
**Note**
4+
CDK Toolkit Library is in developer preview and is subject to change\.
5+
6+
## What is the CDK Toolkit Library Library?<a name="toolkit-library-intro"></a>
7+
8+
The AWS Cloud Development Kit \(AWS CDK\) Toolkit Library enables you to perform AWS CDK actions requiring programmatic access on AWS\. You can use the CDK Toolkit Library to implement actions such as bootstrapping, synthesizing, and deploying through code rather than CDK CLI commands\. With this library, you can create custom tools, build specialized CLI applications, and integrate CDK programmatic access capabilities into your development workflows\.
9+
10+
The following is an example, that installs the CDK Toolkit Library and uses it to deploy a cloud assembly of your CDK app:
11+
12+
```
13+
import { Toolkit } from '@aws-cdk/toolkit-lib'; // Install the CDK Toolkit Library
14+
15+
const cdk = new Toolkit(); // Create a CDK Toolkit instance
16+
17+
// ...
18+
19+
// Implement a deployment
20+
await cdk.deploy(cloudAssembly, {
21+
deploymentMethod: { method: "direct" }, // Configure deployment options
22+
...
23+
}
24+
```
25+
26+
## Get started with the CDK Toolkit Library<a name="toolkit-library-gs"></a>
27+
28+
To get started, see the `[ReadMe](https://www.npmjs.com/package/@aws-cdk/toolkit-lib)` in the *@aws\-cdk/toolkit\-lib* `npm` package\.

0 commit comments

Comments
 (0)