AWS Lambda
Developer Guide

AWS SAM Template for a Kinesis Application

You can build this application using AWS SAM. To learn more about creating AWS SAM templates, see AWS SAM Template Basics in the AWS Serverless Application Model Developer Guide.

Below is a sample AWS SAM template for the Lambda application from the tutorial. Copy the text below to a YAML 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 kinesis-trigger.yml

AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Resources: ProcessKinesisRecords: Type: AWS::Serverless::Function Properties: Handler: handler Runtime: runtime Policies: AWSLambdaKinesisExecutionRole Events: Stream: Type: Kinesis Properties: Stream: !GetAtt ExampleStream.Arn BatchSize: 100 StartingPosition: TRIM_HORIZON ExampleStream: Type: AWS::Kinesis::Stream Properties: ShardCount: 1

For information on how to package and deploy your serverless application using the package and deploy commands, see Deploying Serverless Applications in the AWS Serverless Application Model Developer Guide.