Amazon SAM template for an API Gateway application
Below is a sample Amazon SAM template for the Lambda application from the tutorial. Copy the text below to a file and save it next to
the ZIP package you created previously. Note that the Handler
and Runtime
parameter values
should match the ones you used when you created the function in the previous section.
Example template.yaml
AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Resources: LambdaFunctionOverHttps: Type: AWS::Serverless::Function Properties: Handler: index.handler Runtime: nodejs18.x Policies: AmazonDynamoDBFullAccess Events: HttpPost: Type: Api Properties: Path: '/DynamoDBOperations/DynamoDBManager' Method: post
For information on how to package and deploy your serverless application using the package and deploy commands, see Deploying serverless applications in the Amazon Serverless Application Model Developer Guide.