
Answer-first summary for fast verification
Answer: Set Lambda to connect to the VPC's private subnets and update security groups for access to the DB instance.
The correct answer is D. In order for the Lambda function to access the Amazon RDS instance in a private subnet within a VPC, the Lambda function must be configured to connect to those private subnets. Additionally, the security group rules must be updated to allow traffic from the Lambda function to the DB instance. Assigning a public IP (option A) or using AWS Direct Connect (option B) are not appropriate solutions, as they do not address the VPC configuration requirements. Using CloudFront for this purpose (option C) is also incorrect; CloudFront is a content delivery network and not suitable for direct access to an RDS instance in a VPC.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
In a serverless application using AWS Lambda, how should a developer enable a Lambda function to access an Amazon RDS instance in a private subnet within a VPC, given that the necessary permissions role is already assigned to the function?
A
Assign a public IP to the DB instance and adjust its security group for Lambda's IP.
B
Create an AWS Direct Connect for connectivity between Lambda and the DB instance.
C
Configure CloudFront to secure the connection between Lambda and the DB instance.
D
Set Lambda to connect to the VPC's private subnets and update security groups for access to the DB instance.