GCP ACE · Question 09 · Domain 1.3: Installing and configuring the CLI
You are writing a bash script that creates a Compute Engine instance. The script needs to run without user interaction and output ONLY the external IP address of the newly created instance in JSON format. How should you format the gcloud command?
Answer options:
gcloud compute instances create ... --silent --output=json
gcloud compute instances create ... --quiet --format="json(networkInterfaces[0].accessConfigs[0].natIP)"
gcloud compute instances create ... --no-prompts --json-only
gcloud compute instances create ... --quiet | grep IP
50 questions · hints · full answers · grading