Deploying AWS Lambda with SAM

The AWS Serverless Application Model (AWS SAM) is a model to define serverless applications. AWS SAM is natively supported by AWS CloudFormation and defines a simplified syntax for expressing serverless resources. You simply define the resources you need as part of your application in the template file and create a CloudFormation stack with the SAM deploy command.

Previously, we saw how AWS SAM can be used to locally test your Lambda function. In addition, SAM can be used to design and deploy your function to AWS Lambda. You can initialize a quick Go-based serverless project (a boilerplate) with the following command:

sam init --name api --runtime go1.x

The preceding command will create a folder with the following ...

Get Hands-On Serverless Applications with Go 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.