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달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠