DOP-C02

Introduction to AWS SAM and the AWS CDK

The two higher-level infrastructure-as-code tools that generate CloudFormation: the AWS Serverless Application Model for serverless applications, and the AWS Cloud Development Kit for defining infrastructure in programming languages, including bootstrapping, testing and self-updating CDK pipelines.

  • 2 lessons
  • Module quiz

CloudFormation templates for real applications become long and repetitive. Two AWS tools generate them from something shorter. The AWS Serverless Application Model (AWS SAM) extends CloudFormation with concise resource types for serverless applications and provides a CLI for building, testing and deploying them. The AWS Cloud Development Kit (AWS CDK) defines infrastructure in programming languages such as TypeScript and Python and synthesises CloudFormation templates from that code.

Where this module fits

The exam guide names AWS SAM and the AWS CDK alongside CloudFormation in its infrastructure-as-code skills. Questions test when each tool is appropriate, how SAM gradual deployments use CodeDeploy, and how CDK bootstrapping, testing and CDK Pipelines support multi-account delivery. Both tools deploy through CloudFormation, so the previous module's concepts still apply.

How this module is organised

Building Serverless Applications with AWS SAM explains the SAM transform, resource types, policy templates, the SAM CLI and gradual deployments. Defining Infrastructure with the AWS CDK explains constructs, apps and stacks, synthesis and bootstrapping, testing with aspects and cdk-nag, and self-updating CDK Pipelines.

  1. Building Serverless Applications with AWS SAM Lesson 1
  2. Defining Infrastructure with the AWS CDK Lesson 2
  3. Practise and review
  4. Test your knowledge 4 questions