
Ultimate access to all questions.
Answer-first summary for fast verification
Answer: Configure the Lambda function to run in the VPC with the appropriate security group.
## Explanation **Correct Answer: A** **Why Option A is correct:** 1. Lambda functions by default run in AWS-managed VPCs and cannot access resources in a customer's VPC or on-premises network. 2. To access resources in a VPC or on-premises network via Direct Connect/VPN, the Lambda function must be configured to run in a VPC with an Elastic Network Interface (ENI). 3. When Lambda runs in a VPC, it gets a private IP address from the subnet and can route traffic through the VPC's route tables. 4. Since the company already has Direct Connect connections and all non-VPC traffic routes to the virtual private gateway, Lambda running in the VPC can access the on-premises database through the existing Direct Connect infrastructure. 5. The appropriate security group must be configured to allow outbound traffic from Lambda to the on-premises database. **Why other options are incorrect:** **Option B:** Setting up a VPN connection is unnecessary because the company already has Direct Connect connections established. This would be redundant and more complex. **Option C:** Simply updating route tables won't work because the Lambda function created through the console runs outside the VPC by default. The Lambda function needs to be configured to run in the VPC first. **Option D:** Elastic IP addresses are for EC2 instances and NAT gateways, not for Lambda functions. Lambda functions cannot be directly associated with Elastic IP addresses without running in a VPC and using a NAT gateway. **Key AWS Concepts:** - Lambda functions need VPC configuration to access VPC resources or on-premises networks - Direct Connect provides dedicated network connections between AWS and on-premises data centers - Security groups control inbound/outbound traffic for resources in VPCs - Route tables determine where network traffic is directed within VPCs
Author: LeetQuiz Editorial Team
No comments yet.
A company has an AWS account used for software engineering. The AWS account has access to the company's on-premises data center through a pair of AWS Direct Connect connections. All non-VPC traffic routes to the virtual private gateway.
A development team recently created an AWS Lambda function through the console. The development team needs to allow the function to access a database that runs in a private subnet in the company's data center.
Which solution will meet these requirements?
A
Configure the Lambda function to run in the VPC with the appropriate security group.
B
Set up a VPN connection from AWS to the data center. Route the traffic from the Lambda function through the VPN.
C
Update the route tables in the VPC to allow the Lambda function to access the on-premises data center through Direct Connect.
D
Create an Elastic IP address. Configure the Lambda function to send traffic through the Elastic IP address without an elastic network interface.