AWSTemplateFormatVersion: '2010-09-09' Transform: 'AWS::Serverless-2016-10-31' Description: An Amazon DynamoDB trigger that logs the updates made to a table. Resources: DynamoDBProcessStreamFunction: Type: 'AWS::Serverless::Function' Properties: Handler: app.handler Runtime: nodejs14.x CodeUri: src/ Description: An Amazon DynamoDB trigger that logs the updates made to a table. MemorySize: 128 Timeout: 3 Events: MyDynamoDBtable: Type: DynamoDB Properties: Stream: !GetAtt MyDynamoDBtable.StreamArn StartingPosition: TRIM_HORIZON BatchSize: 100 MyDynamoDBtable: Type: 'AWS::DynamoDB::Table' Properties: AttributeDefinitions: - AttributeName: id AttributeType: S KeySchema: - AttributeName: id KeyType: HASH ProvisionedThroughput: ReadCapacityUnits: 5 WriteCapacityUnits: 5 StreamSpecification: StreamViewType: NEW_IMAGE