AWS Certified Security – Specialty — Question 341
A company has two VPCs in the same AWS Region and in the same AWS account. Each VPC uses a CIDR block that does not overlap with the CIDR block of the other VPC. One VPC contains AWS Lambda functions that run inside a subnet that accesses the internet through a NAT gateway. The Lambda functions require access to a publicly accessible Amazon Aurora MySQL database that is running in the other VPC.
A security engineer determines that the Aurora database uses a security group rule that allows connections from the NAT gateway IP address that the Lambda functions use. The company’s security policy states that no database should be publicly accessible.
What is the MOST secure way that the security engineer can provide the Lambda functions with access to the Aurora database?
Answer options
- A. Move the Aurora database into a private subnet that has no internet access routes in the database's current VPC. Configure the Lambda functions to use the Aurora database’s new private IP address to access the database. Configure the Aurora database's security group to allow access from the private IP addresses of the Lambda functions.
- B. Establish a VPC endpoint between the two VPCs. In the Aurora database's VPC, configure a service VPC endpoint for Amazon RDS. In the Lambda functions’ VPC, configure an interface VPC endpoint that uses the service endpoint in the Aurora database's VPC. Configure the service endpoint to allow connections from the Lambda functions
- C. Establish an AWS Direct Connect interface between the VPCs. Configure the Lambda functions to use a new route table that accesses the Aurora database through the Direct Connect interface. Configure the Aurora database's security group to allow access from the Direct Connect interface IP address,
- D. Move the Lambda functions into a public subnet in their VPC. Move the Aurora database into a private subnet in its VPC. Configure the Lambda functions to use the Aurora database's new private IP address to access the database. Configure the Aurora database to allow access from the public IP addresses of the Lambda functions.
Correct answer: B
Explanation
Option B is the correct choice because establishing private VPC endpoints (utilizing AWS PrivateLink) allows the VPCs to communicate securely and privately over the AWS network backbone without exposing the database to the public internet. Option A is incorrect because private IP routing between two distinct VPCs is not natively supported without a peering connection or transit gateway. Options C and D are incorrect because Direct Connect is meant for hybrid on-premises connectivity, and exposing public IPs for database access violates the company's security policy.