How To Trigger Lambda From SNS (2 Min) | AWS Lambda Function With Simple Notification Service

Описание к видео How To Trigger Lambda From SNS (2 Min) | AWS Lambda Function With Simple Notification Service

In this tutorial, you'll learn how to trigger a Lambda function from the Simple Notification Service (SNS) and verify the logs using CloudWatch.
_
Video Transcript:
_
Hi guys, this is Abhi from Gokcedb. In this video, you're going to learn how to trigger a Lambda function using a simple notification service. Let's start by navigating to the Lambda service then click on create function and give it a name. Choose Python from the runtime dropdown, click on create function, and scroll down to the code Source section.

Here I'm going to write a print statement to print the event then click on deploy then hit the test button. Give your test event a name then hit save. Then click on test again to execute your Lambda function.

You should see your event printed in the function logs. Next, let's head to the simple notification service and then click on topics. Click on create topic then choose a topic type.

Give your topic a name then click on the create button. Navigate back to the Lambda window and click on the ADD trigger. Choose SNS from The Source drop-down then select the SNS topic that we just created.

Let's head back to the SNS window and click on publish message enter a text message body then click on publish. Now head to the Lambda window and click on the monitor tab. Select logs then click on View Cloud watch logs.

Go inside the latest log stream to see your function logs. Here you should be able to view your event details such as topic ARN and your test message. There you have it.

Make sure you like, subscribe, and turn on your notification bell. Until next time.

Комментарии

Информация по комментариям в разработке