Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

cdk synthesize

Focus mode
cdk synthesize - AWS Cloud Development Kit (AWS CDK) v2

This is the AWS CDK v2 Developer Guide. The older CDK v1 entered maintenance on June 1, 2022 and ended support on June 1, 2023.

This is the AWS CDK v2 Developer Guide. The older CDK v1 entered maintenance on June 1, 2022 and ended support on June 1, 2023.

Synthesize a CDK app to produce a cloud assembly, including an AWS CloudFormation template for each stack.

Cloud assemblies are files that include everything needed to deploy your app to your AWS environment. For example, it includes a CloudFormation template for each stack in your app, and a copy of the file assets or Docker images that you reference in your app.

If your app contains a single stack or if a single stack is provided as an argument, the CloudFormation template will also be displayed in the standard output (stdout) in YAML format.

If your app contains multiple stacks, cdk synth will synthesize the cloud assembly to cdk.out.

Usage

$ cdk synthesize <arguments> <options>

Arguments

CDK stack ID

The construct ID of the CDK stack from your app to synthesize.

Type: String

Required: No

Options

For a list of global options that work with all CDK CLI commands, see Global options.

--exclusively, -e BOOLEAN

Only synthesize requested stacks, don't include dependencies.

--help, -h BOOLEAN

Show command reference information for the cdk synthesize command.

--quiet, -q BOOLEAN

Do not output the CloudFormation template to stdout.

This option can be configured in the CDK project’s cdk.json file. The following is an example:

{ "quiet": true }

Default value: false

--validation BOOLEAN

Validate the generated CloudFormation templates after synthesis by performing additional checks.

You can also configure this option through the validateOnSynth attribute or CDK_VALIDATION environment variable.

Default value: true

Examples

Synthesize the cloud assembly for a CDK stack with logial ID MyStackName and output the CloudFormation template to stdout

$ cdk synth MyStackName

Synthesize the cloud assembly for all stacks in a CDK app and save them into cdk.out

$ cdk synth

Synthesize the cloud assembly for MyStackName, but don’t include dependencies

$ cdk synth MyStackName --exclusively

Synthesize the cloud assembly for MyStackName, but don’t output the CloudFormation template to stdout

$ cdk synth MyStackName --quiet

On this page

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.