I've set a DynamoDB stream to trigger a simple Lambda function, which works to trigger the function but returns an empty event object. I'm expecting the usual response with Keys, Oldimage, Newimage etc...
The event is passed correctly when I test the function manually in the console as well as when I trigger it with API Gateway. My Execution role has admin access. I even replicated the aws stream/lambda tutorial with the same issue. This should be really simple to do and it's driving me crazy!
My function couldn't be any simpler:
def get_event(event, context):
print(event)
return {
'statusCode': 200,
'body': event
}
And here is my CloudWatch Log with the empty event:
"StatusCode": 200,
"LogResult": START RequestId: 48ec33f4-8707-4d16-9f53-4c7fcf7413d1 Version: $LATEST
{}
END RequestId: 48ec33f4-8707-4d16-9f53-4c7fcf7413d1
REPORT RequestId: 48ec33f4-8707-4d16-9f53-4c7fcf7413d1 Duration: 7.74 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 71 MB
In case it's useful, my Event source mapping for my function
{
"EventSourceMappings": [
{
"UUID": "ce6d850*********************",
"BatchSize": 100,
"EventSourceArn": "arn:aws:dynamodb:us-east- 1:**********:table/EventsDatabase/stream/2019-06-24T14:02:23.578",
"FunctionArn": "arn:aws:lambda:us-east-1:***********:function:email_sender",
"LastModified": 1561872060.0,
"LastProcessingResult": "OK",
"State": "Enabled",
"StateTransitionReason": "User action"
}
]
}