
Answer-first summary for fast verification
Answer: Ensure that clients use Compute Engine internal DNS by connecting to the instance name with the url https://[INSTANCE_NAME].[ZONE].c.[PROJECT_ID].internal/.
The requirement is to allow clients within the same VPC to resolve the IP address of the HTTP API hosted on a Compute Engine VM. Option B correctly leverages Compute Engine's internal DNS, which resolves the instance name to its internal IP address. The URL format provided in B matches the structure of internal DNS names ([INSTANCE_NAME].[ZONE].c.[PROJECT_ID].internal), ensuring clients within the VPC can resolve the IP. Options A and C involve external IP addresses via HTTP(S) load balancing, which exposes the service publicly, violating the internal-only access requirement. Option D uses an incorrect URL format for internal DNS. Thus, B is the only valid solution.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
You are building an HTTP API hosted on a Compute Engine VM instance that should only be accessible by multiple clients within the same VPC. The clients need to resolve the service's IP address. What is the recommended approach?
A
Reserve a static external IP address and assign it to an HTTP(S) load balancing service's forwarding rule. Clients should use this IP address to connect to the service.
B
Ensure that clients use Compute Engine internal DNS by connecting to the instance name with the url https://[INSTANCE_NAME].[ZONE].c.[PROJECT_ID].internal/.
C
Reserve a static external IP address and assign it to an HTTP(S) load balancing service's forwarding rule. Then, define an A record in Cloud DNS. Clients should use the name of the A record to connect to the service.
D
Ensure that clients use Compute Engine internal DNS by connecting to the instance name with the url https://[API_NAME]/[API_VERSION]/.
No comments yet.