DVA-C02 · Question #551
A developer is deploying a new Node.js AWS Lambda function that is not connected to a VPC. The Lambda function needs to connect to and query an Amazon Aurora database that is not publicly accessible.
The correct answer is A. Configure the Lambda function to use an Amazon RDS proxy.. Amazon RDS Proxy manages and pools database connections from Lambda, preventing connection exhaustion during unpredictable traffic surges while also enabling Lambda to reach the private Aurora instance.
Question
A developer is deploying a new Node.js AWS Lambda function that is not connected to a VPC. The Lambda function needs to connect to and query an Amazon Aurora database that is not publicly accessible. The developer is expecting unpredictable surges in database traffic. What should the developer do to give the Lambda function access to the database?
Options
- AConfigure the Lambda function to use an Amazon RDS proxy.
- BConfigure a NAT gateway. Attach the NAT gateway to the Lambda function.
- CEnable public access on the Aurora database. Configure a security group on the database to
- DEnable VPC access for the Lambda function. Attach the Lambda function to a new security group
How the community answered
(57 responses)- A61% (35)
- B23% (13)
- C5% (3)
- D11% (6)
Why each option
Amazon RDS Proxy manages and pools database connections from Lambda, preventing connection exhaustion during unpredictable traffic surges while also enabling Lambda to reach the private Aurora instance.
Amazon RDS Proxy sits between Lambda and Aurora, maintaining a warm pool of persistent database connections. When Lambda experiences traffic surges, RDS Proxy multiplexes thousands of Lambda invocations over a smaller set of long-lived connections, preventing Aurora from being overwhelmed. RDS Proxy also provides a stable endpoint that Lambda can connect to, resolving the private connectivity requirement.
A NAT gateway enables outbound internet access from private subnets; it does not provide access to a non-publicly accessible Aurora database, and Lambda in this scenario is not attached to a VPC.
Making the Aurora database publicly accessible introduces a significant security risk and is contrary to best practices for database exposure.
Enabling VPC access for Lambda would allow network connectivity to Aurora, but without RDS Proxy it does not address the connection exhaustion problem caused by unpredictable Lambda concurrency surges.
Concept tested: RDS Proxy for Lambda connection pooling with Aurora
Source: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-proxy.html
Community Discussion
No community discussion yet for this question.