July 2018
Intermediate to advanced
350 pages
8h 47m
English
Now that we have installed AWS SAM CLI, let's define a SAM template so that we can test the AWS Lambda function that we created locally earlier, package the serverless application, and deploy it to an AWS environment.
In Visual Studio Code editor, create a new file called template.yaml next to where we created the index.js file earlier. In the template.yaml file, enter the following contents:
AWSTemplateFormatVersion: '2010-09-09'Transform: AWS::Serverless-2016-10-31Description: > hello-world SAM Template for hello-world appGlobals: Function: Timeout: 3Resources: HelloWorldFunction: Type: AWS::Serverless::Function Properties: CodeUri: . Handler: index.handler Runtime: nodejs8.10 Events: HelloWorld ...