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

后端 未结 4 1679
走了就别回头了
走了就别回头了 2021-01-03 22:10

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

4条回答
  •  滥情空心
    2021-01-03 22:45

    I finally managed to get it working...

    The trick is that you MUST have 2 subnets.

    A public one, with a routing table that sends traffic to the Internet Gateway of your VPC. Put the NAT in there.

    And a private one, with a routing table that sends traffic to the NAT. Put the Lambdas in there. (BTW Making a public subnet means setting the Auto-assign Public IP option to Yes.)

    It is outlined in this overview diagram from the AWS docs:

    http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Scenario2.html#Configuration-2

提交回复
热议问题