How to let AWS lambda in a VPC to publish SNS notification?

lawrence picture lawrence · Mar 14, 2016 · Viewed 9k times · Source

I have a lambda function that accesses my Postgres db in RDS via VPC. After it queries the db, I want to post a notification to SNS. Because my lambda function exists in my VPC, it cannot access SNS. I have an internet gateway on my VPC. I read through the VPC endpoint documentation and currently only s3 is supported.

Is there anyway to publish to SNS in a lambda function in a VPC?

Answer

Khalid T. picture Khalid T. · Apr 15, 2018

UPDATE

As of April 2018, SNS supports VPC Endpoints via AWS PrivateLink. So, there will be no need to set up an Internet Gateway or a NAT instance in order for a Lambda function inside your VPC to publish SNS notifications.

See this blog post for more details.