AWS Certified Developer – Associate (DVA-C02) — Question 352

A company is developing a serverless application by using AWS Lambda functions. One of the Lambda functions needs to access an Amazon RDS DB instance. The DB instance is in a private subnet inside a VPC.

The company creates a role that includes the necessary permissions to access the DB instance. The company then assigns the role to the Lambda function. A developer must take additional action to give the Lambda function access to the DB instance.

What should the developer do to meet these requirements?

Answer options

Correct answer: D

Explanation

To allow an AWS Lambda function to access resources inside a private subnet of a VPC, such as an Amazon RDS DB instance, the Lambda function must be configured to connect to that VPC. Additionally, the security group associated with the RDS DB instance must be updated to allow inbound traffic from the Lambda function's security group. Options A, B, and C are incorrect because they either compromise security by exposing the database publicly, or use services (Direct Connect, CloudFront) that are not designed for internal Lambda-to-VPC database connectivity.