Triggering AWS Lambda using SNS topic

Adesh Kotgirwar
2 min readFeb 8, 2023

--

To trigger a Lambda function using an Amazon SNS (Simple Notification Service) topic, follow these steps:

Step 1: Create a Lambda function The first step is to create the Lambda function that will be executed when the SNS topic is triggered. To do this, go to the AWS Lambda console and create a new function. When creating the function, you will need to specify the handler function that will be executed, the runtime environment, and any required dependencies.

Step 2: Create an SNS topic Next, you will need to create an SNS topic. To do this, go to the Amazon SNS console and create a new topic. You can specify the name and display name for the topic, and choose whether you want it to be a public or private topic.

Step 3: Add a subscription to the SNS topic Once you have created the SNS topic, you will need to add a subscription to it. To do this, choose the “Lambda” protocol and select the Lambda function you created in step 1.

Step 4: Configure the Lambda function trigger Next, you will need to configure the trigger for the Lambda function. To do this, go to the configuration page for the function and select the SNS topic under the “Triggers” section.

Step 5: Verify the trigger Finally, you can verify that the trigger is working by publishing a message to the SNS topic and verifying that the Lambda function is executed.

Once these steps are completed, your Lambda function will be triggered every time a message is published to the SNS topic, making it a powerful tool for event-driven processing in AWS.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Adesh Kotgirwar
Adesh Kotgirwar

Written by Adesh Kotgirwar

Software engineer, passion for technology and its potential to solve real-world problems has driven me to pursue a career in software engineering.

No responses yet

Write a response