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

A company is updating an application to move the backend of the application from Amazon EC2 instances to a serverless model. The application uses an Amazon RDS for MySQL DB instance and runs in a single VPC on AWS. The application and the DB instance are deployed in a private subnet in the VPC.

The company needs to connect AWS Lambda functions to the DB instance.

Which solution will meet these requirements?

Answer options

Correct answer: B

Explanation

Option B is correct because it ensures that the Lambda functions can access resources within the VPC, which is necessary for connecting to the RDS instance. The AWSLambdaVPCAccessExecutionRole policy grants the required permissions for VPC access, while the RDS security group must be modified to allow traffic from the Lambda functions. Options A, C, and D either do not provide the necessary VPC access or involve configurations that are not suitable for connecting to the RDS instance.