
Answer-first summary for fast verification
Answer: Create an AWS PrivateLink interface endpoint for the Lambda function; connect using the private endpoint.
Lambda in VPC needs to connect privately. Using AWS PrivateLink (interface endpoint for services like RDS if supported, but for DB in private subnet, ensuring Lambda is in same VPC with proper security groups/NACLs, but the option points to PrivateLink for secure private connectivity without public internet. Moving to public compromises security. IAM is for auth not network. Connecting Lambda to DB VPC assumes it's not already.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
A Lambda function cannot connect to a database that was moved to a private subnet. How should this be resolved without compromising security?
A
Create an AWS PrivateLink interface endpoint for the Lambda function; connect using the private endpoint.
B
Connect the Lambda function to the database VPC; connect using its private endpoint.
C
Attach an IAM role to the Lambda function with read permissions to the database.
D
Move the database back to a public subnet; use security groups for secure access.
No comments yet.