I'm trying to connect a Lambda function as a trigger for a DynamoDB table.
In my serverless.yml file, I have defined a Lambda function and a DynamoDB table.
Question: How can I attach the Lambda function as a trigger to the DynamoDB?
My serverless.yaml (simplified):
functions:
pushLeadEvent:
handler: handler.pushLeadEvent
events:
- /* WHAT TO DO HERE? */
resources:
Resources:
leadEvent:
Type: AWS::DynamoDB::Table
Properties:
TableName: leadEvent
BillingMode: PAY_PER_REQUEST
AttributeDefinitions:
- AttributeName: owner
AttributeType: S
- AttributeName: timestamp
AttributeType: N
KeySchema:
- AttributeName: owner
KeyType: HASH
- AttributeName: timestamp
KeyType: RANGE