What is AWS SAM (Serverless Application Model)?
Answer
AWS SAM is AWS's open-source framework for building serverless applications. It extends CloudFormation with serverless-specific resource types and shorthand. Key features: (1) Simplified syntax — AWS::Serverless::Function replaces complex CloudFormation Lambda + IAM + Event Source Mapping resources; (2) Local testing — sam local invoke runs Lambda locally in a Docker container; sam local start-api runs API Gateway locally; (3) Deployment — sam build packages dependencies; sam deploy --guided deploys with an interactive wizard; (4) AWS native — uses CloudFormation under the hood, inheriting all CloudFormation features; (5) Layers — AWS::Serverless::LayerVersion for shared code; (6) Connectors — AWS::Serverless::Connector automatically configures IAM permissions between resources. SAM is the recommended AWS-native choice for greenfield serverless projects, while CDK is preferred for teams comfortable with TypeScript/Python code-first infrastructure definition.
Previous
How do you implement microservices with serverless?
Next
How do you monitor and debug serverless functions?
More Serverless Architecture Questions
View all →- Intermediate How do you reduce cold start latency in serverless functions?
- Intermediate What is AWS Step Functions and when would you use it?
- Intermediate How do you handle state in serverless applications?
- Intermediate What is the Serverless Framework and how does it work?
- Intermediate How do you implement authentication in a serverless API?