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
demandé il y a 2 mois133 vues
1 réponse
0

Hello Andrew,

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

AWS
EXPERT
répondu il y a 2 mois

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions