Introduction to the AWS CDK
Define cloud infrastructure in familiar programming languages.
- 1 lesson
- Module quiz
CloudFormation templates describe every resource and property explicitly, which makes large templates long and repetitive. They also cannot use the tools developers rely on in ordinary code, such as loops, functions, classes and unit tests.
The AWS Cloud Development Kit (AWS CDK) lets developers define infrastructure in programming languages such as TypeScript, Python, Java, C# and Go. Resources are represented by classes called constructs, which can supply sensible defaults and combine several resources into a reusable pattern. Running the CDK converts the program into a CloudFormation template, a step called synthesis, and CloudFormation then deploys it, so the CDK keeps all of CloudFormation's safety features. The CDK is free; the resources it creates are charged. Each account and Region must be prepared once with cdk bootstrap, which creates the resources the CDK needs for deployment.
Where the CDK fits
On the exam, the CDK is the answer when a team wants to define infrastructure in a general-purpose programming language. Questions test the fact that the CDK produces CloudFormation, the levels of construct, and the CLI commands for synthesising, comparing and deploying stacks.
How this module is organised
The module has a single lesson, Defining Infrastructure in Code with the AWS CDK, which explains apps, stacks and constructs, the CDK CLI workflow and bootstrapping, and how the CDK compares with CloudFormation and SAM.