Google Cloud Associate Cloud Engineer — Question 120
You have downloaded and installed the gcloud command line interface (CLI) and have authenticated with your Google Account. Most of your Compute Engine instances in your project run in the europe-west1-d zone. You want to avoid having to specify this zone with each CLI command when managing these instances.
What should you do?
Answer options
- A. Set the europe-west1-d zone as the default zone using the gcloud config subcommand.
- B. In the Settings page for Compute Engine under Default location, set the zone to europeג€"west1-d.
- C. In the CLI installation directory, create a file called default.conf containing zone=europeג€"west1ג€"d.
- D. Create a Metadata entry on the Compute Engine page with key compute/zone and value europeג€"west1ג€"d.
Correct answer: A
Explanation
The correct answer is A because using the gcloud config subcommand allows you to set the default zone for all subsequent commands, streamlining your workflow. The other options do not provide a method to set the default zone for the gcloud CLI; they pertain to settings specific to the Compute Engine interface or involve creating files that do not impact the CLI behavior.