Intrigued by the art of cloud architecture? Discover how to design, develop, and manage robust, secure, scalable, and dynamic solutions on Google Cloud as you prepare for the Professional Cloud Architect exam!
Prepare and test your skills
Prepare and test your skills
Worked example. The correct answer is already marked and every option is explained below, so there is nothing to select here. To answer questions yourself, start the free trial.
Keep the momentum going with these hand-picked practice scenarios
Want more questions like this?
Get a free certification question every week.
Last updated
A cloud architect is developing an administrative shell script to automate operational maintenance across multiple environments that use distinct service accounts and settings.
The script must satisfy the following technical requirements:
Which combination of gcloud CLI commands and flags meets these requirements?
Switch contexts by setting gcloud config set core/project, apply per-invocation overrides using gcloud config configurations describe, and extract raw attribute values using --format="text".
Switch contexts by deleting and recreating profiles using gcloud config configurations delete and create, apply per-invocation overrides using gcloud config unset, and extract raw attribute values using --format="flattened(PROPERTY)".
Switch contexts using gcloud init --skip-diagnostics, set per-invocation overrides using gcloud config set, and extract raw attribute values using --format="table[no-heading](PROPERTY)".
Switch contexts using gcloud config configurations activate, apply per-invocation overrides using command flags such as --project, and extract raw attribute values using --format="value(PROPERTY)".
Switch contexts by setting gcloud config set core/project, apply per-invocation overrides using gcloud config configurations describe, and extract raw attribute values using --format="text".
Switch contexts by deleting and recreating profiles using gcloud config configurations delete and create, apply per-invocation overrides using gcloud config unset, and extract raw attribute values using --format="flattened(PROPERTY)".
Switch contexts using gcloud init --skip-diagnostics, set per-invocation overrides using gcloud config set, and extract raw attribute values using --format="table[no-heading](PROPERTY)".
Switch contexts using gcloud config configurations activate, apply per-invocation overrides using command flags such as --project, and extract raw attribute values using --format="value(PROPERTY)".
In the Google Cloud CLI, a named configuration is a distinct, saved group of settings and properties (such as authenticated accounts, target projects, default regions, and zones). The gcloud config configurations activate command switches the active CLI profile to the specified configuration instantly. To format output for administrative scripting, the global --format flag controls the output projection, where the value() transform prints raw property values without headers or decoration.
gcloud config configurations activate switches all active CLI properties—including authentication identity and default project—without interactive prompts or credential re-entry.--project PROJECT_ID takes precedence over stored configuration properties for only that specific execution, leaving the active configuration's underlying properties unchanged.--format="value(PROPERTY)" expression strips all table headers, borders, and wrapper formatting, printing only the requested property value so it can be assigned directly to shell variables.value() formatting with shell variable assignments eliminates the need for complex external text processing tools like awk, sed, or cut.This pattern leverages native Google Cloud SDK configuration management features. It completely avoids error-prone shell text parsing, maintains isolated credential contexts, and avoids persistent state corruption caused by repeatedly mutating active configuration properties.