CDK Synthesis

The CDK Synthesizes CloudFormation

The AWS CDK 24 (github.com/aws/aws-cdk (https://github.com/aws/aws-cdk 12,914 ), Apache 2.0) describes a stack in TypeScript, JavaScript, Python, Java, C# or Go. Your program builds a tree of constructs; cdk synth writes the CloudFormation 24 template they describe to cdk.out, and cdk deploy hands it to CloudFormation, so stacks and change sets work as this chapter taught. L1 constructs (CfnTable) map one to one onto resource types, L2 constructs (Table) add defaults and methods such as grantReadData, and L3 patterns combine resources. The library is aws-cdk-lib 2.271.0; the command-line CDK Toolkit ships separately as the aws-cdk package (2.1143.0).

From a CDK app to a deployed stack: synthesis is local, deployment is ordinary CloudFormation
From a CDK app to a deployed stack: synthesis is local, deployment is ordinary CloudFormation

A one-time cdk bootstrap creates the CDKToolkit stack: an asset bucket, an ECR 24 repository for container images, and deployment roles. LocalStack 63,725 's cdklocal 305 3.0.4 (github.com/localstack/aws-cdk-local (https://github.com/localstack/aws-cdk-local 305 )) runs the Toolkit against LocalStack. The library, Toolkit and cdklocal are pinned in cdk/package.json and run with npx.