AWS cdk documentation change
Summary
Restructured documentation with expanded content about CDK Toolkit Library capabilities, usage scenarios, and code examples. Added sections for understanding the library, choosing when to use it, implementation examples, and next steps.
Security assessment
The changes focus on improving documentation structure and adding implementation details rather than addressing security vulnerabilities. While the library enables infrastructure management capabilities, there is no mention of security patches, vulnerabilities, or new security controls in the diff. The changes appear to be routine documentation improvements for better developer experience.
Diff
diff --git a/cdk/v2/guide/toolkit-library.md b/cdk/v2/guide/toolkit-library.md index 1637ab87c..ad8229688 100644 --- a//cdk/v2/guide/toolkit-library.md +++ b//cdk/v2/guide/toolkit-library.md @@ -5 +5 @@ -What is the CDK Toolkit Library Library?Get started with the CDK Toolkit Library +Understanding the CDK Toolkit LibraryChoosing when to use the CDK Toolkit LibraryUsing the CDK Toolkit LibraryNext stepsLearn more @@ -11 +11 @@ This is the AWS CDK v2 Developer Guide. The older CDK v1 entered maintenance on -###### Note +## Understanding the CDK Toolkit Library @@ -13 +13 @@ This is the AWS CDK v2 Developer Guide. The older CDK v1 entered maintenance on -CDK Toolkit Library is in developer preview and is subject to change. +The CDK Toolkit Library enables you to perform CDK actions programmatically through code instead of using CLI commands. You can use this library to create custom tools, build specialized CLI applications, and integrate CDK capabilities into your development workflows. @@ -15 +15 @@ CDK Toolkit Library is in developer preview and is subject to change. -## What is the CDK Toolkit Library Library? +**Manage your infrastructure lifecycle with programmatic control** @@ -17 +16,0 @@ CDK Toolkit Library is in developer preview and is subject to change. -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. @@ -19 +18 @@ The AWS Cloud Development Kit (AWS CDK) Toolkit Library enables you to perform A -The following is an example, that installs the CDK Toolkit Library and uses it to deploy a cloud assembly of your CDK app: +The CDK Toolkit Library provides programmatic interfaces for the following CDK actions: @@ -20,0 +20 @@ The following is an example, that installs the CDK Toolkit Library and uses it t + * **Synthesis** \- Generate AWS CloudFormation templates and deployment artifacts. @@ -22 +22 @@ The following is an example, that installs the CDK Toolkit Library and uses it t - import { Toolkit } from '@aws-cdk/toolkit-lib'; // Install the CDK Toolkit Library + * **Deployment** \- Provision or update infrastructure using CloudFormation templates. @@ -24 +24 @@ The following is an example, that installs the CDK Toolkit Library and uses it t - const cdk = new Toolkit(); // Create a CDK Toolkit instance + * **List** \- View information about stacks and their dependencies. @@ -26 +26 @@ The following is an example, that installs the CDK Toolkit Library and uses it t - // ... + * **Watch** \- Monitor CDK apps for local changes. @@ -28,5 +28,96 @@ The following is an example, that installs the CDK Toolkit Library and uses it t - // Implement a deployment - await cdk.deploy(cloudAssembly, { - deploymentMethod: { method: "direct" }, // Configure deployment options - ... - }) + * **Rollback** \- Return stacks to their last stable state. + + * **Destroy** \- Remove CDK stacks and associated resources. + + + + +**Enhance and customize your infrastructure management** + + + * **Control through code** \- Integrate infrastructure management directly into your applications and build responsive deployment pipelines. + + * **Manage cloud assemblies** \- Create, inspect, and transform your infrastructure definitions before deployment. + + * **Customize deployments** \- Configure parameters, rollback behavior, and monitoring to match your requirements. + + * **Handle errors precisely** \- Implement structured error handling with detailed diagnostic information. + + * **Tailor communications** \- Configure custom progress indicators and logging through `IoHost` implementations. + + * **Connect with AWS** \- Configure profiles, Regions, and authentication flows programmatically. + + + + +## Choosing when to use the CDK Toolkit Library + +The CDK Toolkit Library is particularly valuable when you need to: + + * Automate infrastructure deployments as part of CI/CD pipelines. + + * Build custom deployment tools tailored to your organization’s needs. + + * Integrate CDK actions into existing applications or platforms. + + * Create specialized deployment workflows with custom validation or approval steps. + + * Implement advanced infrastructure management patterns across multiple environments. + + + + +## Using the CDK Toolkit Library + +The following example shows how to create and deploy a simple S3 bucket using the CDK Toolkit Library: + + + // Import required packages + import { Toolkit } from '@aws-cdk/toolkit-lib'; + import { App, Stack } from 'aws-cdk-lib'; + import * as s3 from 'aws-cdk-lib/aws-s3'; + + // Create and configure the CDK Toolkit + const toolkit = new Toolkit(); + + // Create a cloud assembly source with an inline app + const cloudAssemblySource = await toolkit.fromAssemblyBuilder(async () => { + const app = new App(); + const stack = new Stack(app, 'SimpleStorageStack'); + + // Create an S3 bucket in the stack + new s3.Bucket(stack, 'MyFirstBucket', { + versioned: true + }); + + return app.synth(); + }); + + // Deploy the stack + await toolkit.deploy(cloudAssemblySource); + +**What you can do next** + + + * **Automate deployments** \- Trigger deployments programmatically and add pre/post deployment steps. + + * **Integrate with systems** \- Connect with CI/CD workflows, custom tools, and monitoring solutions. + + * **Control deployment details** \- Configure fine-grained options for stack selection and multi-environment deployments. + + * **Enhance reliability** \- Implement production-ready error handling and deployment progress tracking. + + + + +## Next steps + +To begin using the CDK Toolkit Library, see [Get started with the CDK Toolkit Library](./toolkit-library-gs.html). + +## Learn more + +To learn more about the CDK Toolkit Library, see the following: + + * [ReadMe](https://www.npmjs.com/package/@aws-cdk/toolkit-lib) in the _@aws-cdk/toolkit-lib_ `npm` package. + + * [AWS CDK Toolkit Library API Reference](https://docs.aws.amazon.com/cdk/api/toolkit-lib/). @@ -34 +124,0 @@ The following is an example, that installs the CDK Toolkit Library and uses it t -## Get started with the CDK Toolkit Library @@ -36 +125,0 @@ The following is an example, that installs the CDK Toolkit Library and uses it t -To get started, see the ` [ReadMe](https://www.npmjs.com/package/@aws-cdk/toolkit-lib) ` in the _@aws-cdk/toolkit-lib_ `npm` package. @@ -38 +126,0 @@ To get started, see the ` [ReadMe](https://www.npmjs.com/package/@aws-cdk/toolki -For API reference information, see the [CDK Toolkit Library API reference](https://docs.aws.amazon.com/cdk/api/toolkit-lib/). @@ -48 +136 @@ Troubleshoot CDK deployments -Test AWS CDK applications +Getting started