> For the complete documentation index, see [llms.txt](https://amartyushov.gitbook.io/tech/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://amartyushov.gitbook.io/tech/tools/cdk.md).

# CDK

## Commands

* cdk synth
  * generating CloudFormation template based on code
* cdk bootstrap
  * `aws profile should have cloudformation:CreateChangeSet permission`&#x20;
  * install bootstrap stack into an environment
* cdk deploy
  * deploy cdk app
* cdk diff
  * diff between CDK app and whats currently deployed

## Notes

* each CDK stack maps 1:1 with CloudFormation stack
* Construct - basic building block of CDK app. Has a constructor with params `(scope, id, props)`&#x20;
  * scope - most likely always the value is `this`&#x20;
  * id - local identity of the construct. CDK uses this id to calculate the CloudFormation Logical ID
  * props - \[optional], set of init properties. Specific to each construct
