Introduction to SAM

In this section, we will learn about SAM, which will help us build and deploy serverless functions:

  1. As mentioned earlier, SAM is about writing infrastructure as code. So, this is what a Lambda function would be described as in SAM:
AWSTemplateFormatVersion: '2010-09-09'Transform: AWS::Serverless-2016-10-31Resources:    < Name of function >:        Type: AWS::Serverless::Function        Properties:            Handler: < index.handler >            Runtime: < runtime >            CodeUri: < URI of the bucket >
  1. In this block of code, we enter the details—the name of the function, and the URI of the S3 bucket where our code package is hosted. In the same way that we named the index and the handler in our Lambda settings, we need to enter those details here, too. The index.handler ...

Get Building Serverless Applications with Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.