Define your cloud infrastructure using a familiar language:
JavaScript/TypeScript, Python, Java, and .NET
Contains high level components called constructs
The code is “compiled” into a CloudFormation template (JSON/YAML)
You can therefore deploy infrastructure and application runtime code together
CDK vs SAM
CDK
All AWS services
Write infra in a programming language JavaScript/TypeScript, Python, Java, and .NET
SAM
Serverless focused
Write your template declaratively in JSON or YAML
Great for quickly getting started with Lambda
Both SAM and CDK use CloudFormation under the hood
CDK Constructus
CDK Construct is a component that encapsulates everything CDK needs to create the final CloudFormation stack
Can represent a single AWS resource (e.g., S3 bucket) or multiple related resources (e.g., worker queue with compute)
AWS Construct Library
A collection of Constructs included in AWS CDK which contains Constructs for every AWS resource
Contains 3 different levels of Constructs available (L1, L2, L3)
Construct Hub – contains additional Constructs from AWS, 3rd parties, and open-source CDK community
CDK Constructs – Layer 1 Constructs (L1)
Can be called CFN Resources which represents all resources directly available in CloudFormation