
Answer-first summary for fast verification
Answer: 1. Utilize gcloud config to establish two distinct configurations. 2. Develop a script to activate each configuration sequentially. 3. For each active configuration, execute `gcloud compute instances list` to retrieve compute resources.
Option A is the correct choice because it involves creating separate gcloud configurations for each project (Development and Production) and scripting the activation of these configurations to automate the listing of instances. This method efficiently retrieves a list of compute resources for each project daily. Option B is incorrect as gsutil is designed for Cloud Storage operations, not Compute Engine management. Options C and D do not address the automation requirement effectively, with Cloud Storage and Cloud SQL being unsuitable for this specific task of listing compute instances. For more details, refer to [Google Cloud SDK configurations](https://cloud.google.com/sdk/docs/configurations) and [gsutil documentation](https://cloud.google.com/storage/docs/gsutil).
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
As the maintainer of the Compute Engine infrastructure for an E-commerce website's Development and Production environments, you currently manually log into the Google Cloud Console to copy the list of running Compute Engine VMs. Your task is to automate the daily listing of all compute instances in both development and production projects using gcloud. What is the best approach?
A
gcloud compute instances list to retrieve compute resources.B
gcloud compute instances list within each configuration to list compute resources.C
Automate the export of this information to Cloud Storage via Cloud Shell on a daily schedule.
D
Schedule the export of this information to Cloud SQL through the Google Cloud Console every day.