---
title: "Discussion on \"Send an SNS notification using AWS Lambda\" | Hashnode"
description: "Discussion on \"Send an SNS notification using AWS Lambda\". Welcome! Today, I am going to show you how to write an AWS Lambda Function that sends an SNS notification. \n🐦 Follow me on Twitter if you would like to see more content like this! 🐦\nTLDR - Here is a link to my Github with the given code.\n1. Initial..."
url: "https://hashnode.com/posts/send-an-sns-notification-using-aws-lambda/60542931406fc6159743156d"
---

[Feed](https://hashnode.com/feed) /

Discussion

[Phillip Ninan](https://hashnode.com/@phillip_ninan)

Senior Software Engineer

Mar 19, 2021

# [Send an SNS notification using AWS Lambda](https://blog.phillipninan.com/send-an-sns-notification-using-aws-lambda?utm_source=hashnode&utm_medium=feed)

Welcome! Today, I am going to show you how to write an AWS Lambda Function that sends an SNS notification. 🐦 Follow me on Twitter if you would like to see more content like this! 🐦 TLDR - Here is a link to my Github with the given code. 1. Initial...

blog.phillipninan.com 3 min read

[#aws](https://hashnode.com/tag/aws) [#aws-lambda](https://hashnode.com/tag/aws-lambda) [#javascript](https://hashnode.com/tag/javascript)

## Responses 2

Markdown supported · ⌘↵ to post

[Catalin Pit](https://hashnode.com/@Catalinpit)

[Mar 19, 2021](https://hashnode.com/posts/send-an-sns-notification-using-aws-lambda/60542931406fc6159743156d/comment/60544de5406fc61597431831)

Interesting, nice article! Is it possible to send any type of notifications? For example, a notification every time someone replies to your tweet?

I know the example is pointless, but just trying to understand how one can use it. 😊

[Benoît Bouré](https://hashnode.com/@bboure)

Software developer

[Mar 19, 2021](https://hashnode.com/posts/send-an-sns-notification-using-aws-lambda/60542931406fc6159743156d/comment/60544de5406fc61597431831#reply-60544f9c406fc615974318bb)

[AWS SNS](https://aws.amazon.com/sns/?whats-new-cards.sort-by=item.additionalFields.postDateTime&whats-new-cards.sort-order=desc) can send messages to many kinds of subscribers: HTTP webhooks, Email, SMS, SQS, Push notification.

In order to trigger it, you can use Lambda like this article shows, or [EventBridge](https://aws.amazon.com/eventbridge/). The possibilities are endless.

[Catalin Pit](https://hashnode.com/@Catalinpit)

[Mar 19, 2021](https://hashnode.com/posts/send-an-sns-notification-using-aws-lambda/60542931406fc6159743156d/comment/60544de5406fc61597431831#reply-605457815718e51c51dea735)

[Benoît Bouré](https://hashnode.com/@bboure), go it! Thanks!

I also followed you on Twitter just now.

[Phillip Ninan](https://hashnode.com/@phillip_ninan)

Senior Software Engineer

[Mar 19, 2021](https://hashnode.com/posts/send-an-sns-notification-using-aws-lambda/60542931406fc6159743156d/comment/60544de5406fc61597431831#reply-6054c81c90e9571f3bb40d2c)

[Catalin Pit](https://hashnode.com/@Catalinpit) thank you for reading!

My use case for this is to be used doing live sporting events. I write software to score different types of [sports in realtime](https://auprosports.com/). I use AWS Lambda and AWS CloudWatch Event Rules to periodically (CRON) query our database to find potential errors. If there are errors our team is notified immediately. Some of our team members get emails while others prefer SMS.

I have an article on deck to query an RDS database using AWS Lambda. Stay tuned!

[Benoît Bouré](https://hashnode.com/@bboure)

Software developer

[Mar 19, 2021](https://hashnode.com/posts/send-an-sns-notification-using-aws-lambda/60542931406fc6159743156d/comment/605443dd8899a615727e6a16)

Great article [Phillip Ninan](https://hashnode.com/@phillip_ninan)

I just wanted to bring something to your attention. With the `aws-sdk`, you can either use the `callback` function (on the request method) - OR - use `.promise()` with `.then()` or `await`. It seems you have made a mix of moth here. The `.promise()` method does not take a callback.

Did I miss something?

[Phillip Ninan](https://hashnode.com/@phillip_ninan)

Senior Software Engineer

[Mar 19, 2021](https://hashnode.com/posts/send-an-sns-notification-using-aws-lambda/60542931406fc6159743156d/comment/605443dd8899a615727e6a16#reply-6054c60294931d1f606c9512)

[Benoît Bouré](https://hashnode.com/@bboure) No, you are correct! I forgot to add a `.then()`. I updated the article and the Github source code. Ironically, the code still executed properly with this error, but the logs were never printed.

Thank you for pointing that out!!
