为什么 VPC 中的 aws lambda 无法向 SNS 发送消息? [英] Why aws lambda within VPC can not send message to SNS?

查看:45
本文介绍了为什么 VPC 中的 aws lambda 无法向 SNS 发送消息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 lambda 函数可以使用无 VPC"的发布方法向 SNS 发送消息,但是当我将其放入可以通过路由和互联网网关访问公共互联网的 VPC 时它会超时.

my lambda function can send message to SNS with publish method with "no VPC", but it will timeout when I put it in a VPC which has access to public internet with route and internet gateway.

我的 lambda 位于一个公共子网中,该子网的 0.0.0.0/0 已路由到 Internet 网关,因此无法再次将其路由到 NAT.是否可以将 EIP 分配给 lambda 函数

I have my lambda in a public subnet which has 0.0.0.0/0 already routed to the internet gateway, so can not route it again to NAT. Is that possible to assign a EIP to lambda function

推荐答案

你必须添加一个 NAT 网关 连接到您的 VPC,以便 Lambda 函数(以及您的 VPC 中没有公共 IP 的其他内容)访问 VPC 之外的任何内容.您应该阅读 此 AWS 公告.

You have to add a NAT Gateway to your VPC in order for Lambda functions (and other things in your VPC that don't have a public IP) to access anything outside the VPC. You should read the Things to Know section of this AWS announcement.

这篇关于为什么 VPC 中的 aws lambda 无法向 SNS 发送消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆