- The sole purpose of AWS CDK is to generate Cloud Formation templates by using standard coding languages.
- There is a anatomy of constructs in CDK like L1 construct and L2 construct you can think of these as a abstraction level within the CDK that you can use.
L1 constructs
- L1 constructs are the building block of the AWS CDK, It maps directly to individual AWS cloud formation resources.
- L1 constructs are also known as CFN (Cloud Formation) resources.
- L1 constructs are generated from AWS Cloud formation specification.
- L1 constructs are the bridge between Cloud Formation and the AWS CDK.
L2 constructs
- L2 constructs are also known as curated constructs
- L2 constructs map directly to single AWS Cloud Formation resources
- Compare too L1 constructs, L2 constructs provide higher level abstractions through an intuitive intent based API.
Ex: L1 construct โ S3.CfnBucket L2 construct โ S3.Bucket
References: