【发布时间】:2018-10-14 16:12:30
【问题描述】:
我设置了一个具有 3 个子网的 VPC,以便从我的 Lambda 函数访问私有 RDS 实例。 RDS Lambda 连接工作正常,但现在我无法发布到 SNS。
我发现了 VPC Endpoint 支持 SNS 的公告(包括这篇博文 https://aws.amazon.com/blogs/security/securing-messages-published-to-amazon-sns-with-aws-privatelink/),并添加了具有以下属性的 VPC Endpoint 接口:
Service name: com.amazonaws.eu-west-1.sns
VPC: same as Lambda functions and other services
Subnets: all included in my VPC (have also tested toggling them individually)
Security Groups: all VPC security groups selected
所有服务都在 eu-west-1 区域。我知道发布到 SNS 的代码是正确的,因为它在非 VPC 环境中运行时有效。我发布到的 ARN 保持不变:arn:aws:sns:eu-west-1:962446592636:whatever。
我知道可以设置 NAT 服务器来避免这个问题,但如果可能的话,我更喜欢使用 VPC 端点来降低成本。
【问题讨论】:
标签: amazon-web-services aws-lambda amazon-sns amazon-vpc