Issue using a single lambda to access RDS resource on VPC and access internet

0

I have an RDS on a VPC with a security group and 2 subnets. I have a lambda that needs to query the RDS and then upload this information to a third party via the internet. When I try to use this lambda without attaching the security group / subnets, I can access the internet, but not the RDS. When I attach the security group / subnets, I can access the RDS, but not the internet. The security group allows all traffic both inbound and outbound. What are the exact steps do I need to take to accomplish my objective? I'm trying to go for a full serverless approach, and this function only needs to run once per day (for around ~10 seconds), so I'd like to not have to pay for a server that needs to run 24/7 to accomplish this objective.

  • Following up, I don't really understand route tables or the difference between internet gateways and NAT gateways, so please keep this in mind when explaining how to solve this problem. Thanks in advance!

  • Following up, the two subnets that are currently attached look to be public subnets, because 0.0.0.0 is targeted at an internet gateway.

    I've tried adding another subnet that targets 0.0.0.0 at a NAT gateway, but this did not solve the problem either.

Andrew
已提问 2 个月前133 查看次数
1 回答
0

Hello Andrew,

Can you try looking at this article ? https://repost.aws/knowledge-center/internet-access-lambda-function

AWS
专家
已回答 2 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则

相关内容