I'm having some trouble invoking locally using serverless.
Using Python3.6 runtime
The function in serverless.yml is:
functions:
myFunction:
events:
- sns: arn:aws:sns:us-east-1:123456789:myTopic
My command is
sls invoke local -f myFunction -s dev -r us-east-1 -p events/myMockedSnsMessage.json
Serverless doesn't like the syntax on the myMockedSnsMessage.json
When I log the event in my lambda function I get something like:
{
'Records': [
{
'Sns': {
'Message': '{"version":"0","id":"a965ce94-fcb2-ad15-319d-04adab1072d0","detail-type":"AWS API Call via CloudTrail",...}'
}
}
]
}
That is, the SNS message is a string with valid JSON inside
How should I store a mock event for an SNS message and still have valid JSON so serverless doesn't yell at me for bad JSON syntax?
myMockedSnsMessage.json? I bet that it is invalid. Please include it in your question. - Noel LlevaresMessageattribute is a string of JSON - maafk