DEV Community

loading...

AWS Lambda SNS Destinations not working on failure or success

Avinash Dalvi
AWS Community Builder | Full Stack Developer | PHP + Angular + Python + AWS | Speaker | Blogger | Leadership I write blog at https://www.internetkatta.com
・1 min read

Reference : https://aws.amazon.com/blogs/compute/introducing-aws-lambda-destinations/

Check this answer said : only async lambda execution only work for destination.

Lambda code :

const AWSManager = require('./AWSManager.js')
const request = require('request-promise'); 

exports.handler = async (event, context) => {
  var input = JSON.stringify(event, null, 2);
  console.log(event.region);
  //console.log("EVENT: \n" + JSON.stringify(event, null, 2))
  // TODO implement

Discussion (1)

Collapse
aviboy2006 profile image
Avinash Dalvi Author

Updated answer in question.

Found answer it was mistake only.

As per explaination given in AWS Lambda w/ SQS trigger, SQS Lambda Destinations, never adds to destination queue is correct only for calling lambda async you have to run different command. And test input from UI doesn't work like async. It works as sync call.

aws lambda invoke \
--function-name lambdaname \
--invocation-type Event \
--payload '{ "name": "Bob" }' \
response.json