
Answer-first summary for fast verification
Answer: Create a private zone on Cloud DNS. Configure the applications using the DNS name.
Creating a private zone on Cloud DNS and configuring applications to use the DNS name allows for dynamic resolution of the database IP address. This approach ensures that any changes to the IP address can be managed by updating the DNS record, without requiring any configuration changes in the GCP applications. Cloud NAT (Option C) is not suitable as it's designed for internet access, not for resolving on-premise database IP changes. Storing the IP as custom metadata (Option A) or querying Compute Engine internal DNS (Option B) would still necessitate updates to the applications or metadata entries when the IP changes.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
In a hybrid cloud environment where your startup is migrating applications to GCP, with some resources remaining on-premises, how can you ensure GCP applications don't require configuration changes if the on-premise database's IP address changes?
A
Store the IP of the database as a custom metadata entry inside each instance, and query the metadata server.
B
Write code in applications to query the Compute Engine internal DNS to retrieve the IP of the database.
C
Configure Cloud NAT for all subnets of your VPC, which will be used by VMs for egress traffic.
D
Create a private zone on Cloud DNS. Configure the applications using the DNS name.