Search code examples
amazon-web-servicesaws-lambdaamazon-sns

How to test Lambda publishing a message via AWS cloud console?


I have a problem with testing the Lambda destination - SNS.

Message is not published after Lambda has successfully run. I invoked the lambda in AWS cloud console using a test event.

Destination and topics are properly configured.

enter image description here

enter image description here



Side note, I can programmatically publish a message via sns.publish().


Question:
Is there a way to publish a message automatically to SNS once Lambda has successfully run via AWS console (using a test event)?


Solution

  • No. The console "synchronously invokes your function with the test event". It must be invoked asynchronously to use the destinations.

    Call the lambda invoke API with --invocation-type Event for asynchronous invocation.