This lab is currently in Beta, content may be updated as we refine the material
LABINTERMEDIATE

SAM Serverless Stack Lifecycle

Build, package, and deploy a SAM serverless application (Lambda + API Gateway + DynamoDB), then configure a Canary10Percent5Minutes deployment with CloudWatch alarm and watch CodeDeploy auto-rollback in action.

60 minutes
aws/devops
SAM Serverless Stack Lifecycle - Platform Engineering Hands-On Lab Icon

Lab Overview

In this lab you'll go end-to-end with the AWS Serverless Application Model (SAM). You'll scaffold a Lambda + API Gateway + DynamoDB application, build it with `sam build`, deploy it with `sam deploy`, and then add a `DeploymentPreference` of `Canary10Percent5Minutes` with a CloudWatch alarm. You'll deploy a v2 of the function and finally trigger the alarm to demonstrate automatic CodeDeploy rollback.

You will:

  • Initialize a SAM template with a Lambda function, API Gateway endpoint, and DynamoDB table
  • Run `sam build` and inspect the `.aws-sam/` build artifacts
  • Deploy the stack with `sam deploy --guided` and invoke the API
  • Add a `DeploymentPreference` (Canary10Percent5Minutes) plus CloudWatch alarm
  • Deploy a v2 of the function and watch the canary shift traffic
  • Tighten the alarm threshold to force CodeDeploy to roll back the deployment

What You'll Learn

Initialize a SAM application with Lambda, API Gateway, and DynamoDB

Build and inspect SAM build artifacts in .aws-sam/

Deploy a SAM stack with sam deploy and verify the API endpoint

Configure a Canary10Percent5Minutes DeploymentPreference with a CloudWatch alarm

Trigger a CloudWatch alarm to force CodeDeploy automatic rollback

Prerequisites

aws-devops-cli-operations-baseline

basic-cloudformation-familiarity

basic-lambda-familiarity

Technologies Covered

awssamlambdaapi-gatewaydynamodbcodedeploycloudwatchcanaryrollbackdop-c02

Part of a Course

This lab is part of the AWS Certified DevOps Engineer - Professional (DOP-C02) course

View All Courses

Choose your plan

Simple, Transparent Pricing

Unlock full access to TeKanAid courses, labs, and bootcamps

MonthlyQuarterly

Pro

Course content without labs

$59/month

Renews automatically. Cancel anytime.

Final price verified at checkout.

  • Full access to all courses
  • Progress tracking
  • Certificate of completion
  • Community access
  • Bootcamp participation
  • New content access
Recommended

Premium

Full access with hands-on labs

$99/month

Renews automatically. Cancel anytime.

Final price verified at checkout.

  • Everything in Pro
  • Unlimited hands-on labs
  • Lab AI Assistant
  • Accelerator bootcamps with live office hours
  • Priority support

Prefer a single course?

Purchase individual courses for a one-time fee of $79. Full access to course content, quizzes, certificates, and community features, lab access is not included.

Browse Courses

Try it free, no credit card

Three free ways to start. All bridge into the paid Premium catalog when you're ready.

Not ready to commit? The crash course is email-only. No academy account required.

Ready to Get Started?

Start this hands-on lab and build real-world Platform Engineering skills

Get Access Now