cdk
AWS Cloud Development Kit CLI
TLDR
Initialize new CDK project
SYNOPSIS
cdk [globaloptions] command [arguments] [commandoptions]
DESCRIPTION
cdk is the AWS Cloud Development Kit CLI for defining cloud infrastructure as code using familiar programming languages. It synthesizes CloudFormation templates from TypeScript, Python, Java, C#, or Go code and deploys them to AWS.
Instead of writing CloudFormation YAML or JSON by hand, developers define infrastructure using constructs -- reusable, composable classes that represent AWS resources. The CDK synthesizes these constructs into CloudFormation templates, which are then deployed to create and manage the actual AWS resources.
The workflow typically involves initializing a project with `cdk init`, writing infrastructure code, previewing changes with `cdk diff`, and deploying with `cdk deploy`. The `cdk watch` command enables hot-reloading during development.
PARAMETERS
--all
Deploy/destroy all stacks--hotswap
Fast deployment when possible--require-approval level
Approval level: never, any-change, broadening--profile name
AWS profile to use--region region
AWS region--output dir
Output directory for synthesized templates--verbose, -v
Verbose output
CONFIGURATION
cdk.json
Project configuration including app entry point, context values, and feature flags.
COMMANDS
init
Create new CDK project from templatelist (ls)
List stacks in CDK appsynth
Synthesize CloudFormation templatedeploy
Deploy stacks to AWSdestroy
Delete stacks from AWSdiff
Show differences between stacksbootstrap
Deploy CDK bootstrap stackwatch
Watch for changes and deploycontext
Manage cached context valuesdocs
Open CDK documentation
CAVEATS
Requires Node.js and AWS credentials configured. Run `cdk bootstrap` once per account/region before first deploy.
