[英]How to connect AWS Lambda and RDS in VPC
How can I create this scenario: 如何创建这种情况:
- A private subnet-1
- Lambda in subnet-1
- RDS in subnet-1(same subnet with Lambda)
- Both inside the same VPC.
is the above feasible and is it a good architecture ? 以上可行吗,这是一个好的架构吗?
I have tried implementing it only issue is, it's timing out. 我尝试实现它的唯一问题是,它正在超时。 But, when the Lambda is out of the subnet-1 it's working fine.
但是,当Lambda离开子网1时,它工作正常。
My understanding is since both RDS and Lambda are in the same subnet they should easily communicate. 我的理解是,由于RDS和Lambda都在同一个子网中,因此它们应该易于通信。
It is perfectly okay to have Amazon RDS and the AWS Lambda function connected to the same private subnet. 将Amazon RDS和AWS Lambda函数连接到同一私有子网是完全可以的。
Some things to note: 注意事项:
Lambda-SG
) Lambda-SG
) RDS-SG
) should permit inbound access on the appropriate port (eg 3306
for MySQL) from Lambda-SG
. RDS-SG
)关联的安全组应允许Lambda-SG
在适当的端口(例如MySQL的3306
)上进行入站访问。 That is, RDS-SG
should permit inbound connections from Lambda-SG
. 也就是说,
RDS-SG
应该允许来自Lambda-SG
入站连接。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.