A Lambda function must make HTTP POST requests to an internal application running on EC2 instances in a private subnet within the same AWS account. Which solution enables the Lambda function to reach the internal application?
Choose an answer
Tap an option to check your answer.
Correct answer: Associate the Lambda function with the VPC and the private subnet (attach the Lambda function to the VPC)..
Why this is the answer
Associating the Lambda function with the VPC and the private subnet allows it to access resources within that VPC, including EC2 instances in private subnets. This directly places the Lambda function's network interface into your VPC, enabling private IP communication. Creating a VPC endpoint is for connecting to AWS services privately, not for connecting to your own EC2 instances. Establishing a VPN connection is overly complex and unnecessary for communication within the same AWS account and VPC; VPNs are typically for connecting disparate networks. Modifying the VPC route table to include the Lambda function's IP address is incorrect because Lambda functions do not have static, user-configurable IP addresses in this context, and routing is handled by the VPC association.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed