DEA-C01 · Question #66
A company uses Amazon RDS to store transactional data. The company runs an RDS DB instance in a private subnet. A developer wrote an AWS Lambda function with default settings to insert, update, or del
The correct answer is B. Update the security group of the DB instance to allow only Lambda function invocations on the C. Configure the Lambda function to run in the same subnet that the DB instance uses.. To allow an AWS Lambda function to connect privately to an Amazon RDS DB instance in a private subnet with the least operational overhead, the Lambda function must be configured within the same VPC and its security group must be permitted to access the DB instance's security grou
Question
A company uses Amazon RDS to store transactional data. The company runs an RDS DB instance in a private subnet. A developer wrote an AWS Lambda function with default settings to insert, update, or delete data in the DB instance. The developer needs to give the Lambda function the ability to connect to the DB instance privately without using the public internet. Which combination of steps will meet this requirement with the LEAST operational overhead? (Choose two.)
Options
- ATurn on the public access setting for the DB instance.
- BUpdate the security group of the DB instance to allow only Lambda function invocations on the
- CConfigure the Lambda function to run in the same subnet that the DB instance uses.
- DAttach the same security group to the Lambda function and the DB instance. Include a self-
- EUpdate the network ACL of the private subnet to include a self-referencing rule that allows access
How the community answered
(37 responses)- A16% (6)
- B70% (26)
- D5% (2)
- E8% (3)
Why each option
To allow an AWS Lambda function to connect privately to an Amazon RDS DB instance in a private subnet with the least operational overhead, the Lambda function must be configured within the same VPC and its security group must be permitted to access the DB instance's security group on the DB port.
Turning on the public access setting for the DB instance would expose it to the public internet, which contradicts the requirement for private connectivity and significantly increases security risks.
Updating the security group of the DB instance to allow inbound traffic from the Lambda function's security group on the specific DB port ensures that the Lambda function can establish a secure network connection to the database while restricting access to only the necessary source.
Configuring the AWS Lambda function to run within the same Virtual Private Cloud (VPC) and subnets as the RDS DB instance enables the Lambda function to obtain an Elastic Network Interface (ENI) within the VPC, allowing it to communicate privately with the DB instance without traversing the public internet.
While attaching the same security group with a self-referencing rule can enable communication, it might not be the most granular or secure approach as it applies identical security policies to both resources, potentially granting unnecessary permissions, and might require more refactoring if existing security groups are in place.
Updating the network ACL of the private subnet is a coarse-grained, stateless network control that typically involves more operational overhead to manage compared to security groups for specific resource-to-resource communication, and it's not the primary method for controlling application-level access within a VPC.
Concept tested: Lambda VPC access to RDS
Source: https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html
Topics
Community Discussion
No community discussion yet for this question.