0PricingLogin
Serverless Backend with AWS Lambda & API Gateway · Lesson

Defining Serverless Resources

Write SAM templates to define Lambda functions, API Gateway endpoints, DynamoDB tables, and other serverless components.

What are SAM Templates?

AWS Serverless Application Model (SAM) templates are a powerful way to define your serverless applications using Infrastructure as Code (IaC).

Instead of manually configuring resources in the AWS console, you describe them in a YAML or JSON file. This makes your deployments repeatable, version-controlled, and easier to manage.

Anatomy of a SAM Template

A SAM template has a clear structure. The most important parts are:

  • AWSTemplateFormatVersion: Specifies the template format version.
  • Transform: Always AWS::Serverless-2016-10-31 for SAM.
  • Description: A brief description of your application.
  • Resources: Where you define all your AWS components.
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: My First SAM App

Resources:
  # Your serverless resources go here

All lessons in this course

  1. Introduction to AWS SAM
  2. Defining Serverless Resources
  3. Deploying SAM Applications
  4. Local Testing and Debugging with SAM CLI
← Back to Serverless Backend with AWS Lambda & API Gateway