Prepare and test your skills
Prepare and test your skills
Free sample question, answered and explained below. The Professional Cloud Architect practice bank has 2,335 more like it. Try 10 free: instant score, no account.
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?
gcloud init --skip-diagnostics, set per-invocation overrides using gcloud config set, and extract raw attribute values using --format="table[no-heading](PROPERTY)".This approach uses gcloud init to re-initialize environment settings, calls gcloud config set to update properties, and attempts to suppress table headers using the table format projection.
gcloud init is designed for initial manual setup and interactive configuration; running it inside automated non-interactive scripts can halt execution waiting for user input.gcloud config set permanently modifies the active profile's properties in the configuration file rather than isolating overrides to a single command invocation.table[no-heading] suppresses column titles, the table formatter can still include whitespace padding and alignment formatting that complicates clean variable parsing in scripts.gcloud init walks users through selecting an account, project, and default compute zone interactively.gcloud config set mutates persistent settings for the entire active CLI profile rather than functioning as a per-invocation override.value() projection is the designated mechanism for returning raw, single-attribute strings for scripting, unlike table projections.This workflow would be appropriate if an administrator were interactively configuring a brand new workstation for the first time and needed a guided setup wizard rather than building an automated headless script.
gcloud config configurations delete and create, apply per-invocation overrides using gcloud config unset, and extract raw attribute values using --format="flattened(PROPERTY)".This approach continuously recreates configurations by invoking gcloud config configurations delete and create, uses gcloud config unset before commands, and outputs data using the flattened format.
gcloud config unset permanently removes property values from the configuration file rather than applying a temporary override to a single command.flattened format renders multi-attribute resources as flat lists with explicit key-value pairings (for example, property: value), which prevents clean scalar extraction without secondary parsing.gcloud config unset modifies the configuration file on disk by stripping the specified property entirely.--format="flattened" is designed for terminal screen readers and accessibility rather than single-value pipeline extractions.You were developing a teardown and cleanup routine to completely decommission an obsolete named profile from an administrator's machine.
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.
gcloud config set core/project, apply per-invocation overrides using gcloud config configurations describe, and extract raw attribute values using --format="text".This approach uses gcloud config set to repeatedly change the active project property, relies on gcloud config configurations describe during command execution, and formats output using the text projection.
core/project using gcloud config set does not switch associated credentials, default compute regions, or custom service endpoints linked to other predefined profiles.gcloud config configurations describe is an informational command used to display the details of a named configuration; it cannot execute functional resource operations or apply per-command overrides.text format outputs property names and values in multi-line hierarchical text format (such as name: value), requiring downstream string manipulation to extract only the target value.gcloud config set core/project modifies only a single property inside the active configuration, which fails when different accounts or zones must also switch simultaneously.gcloud config configurations describe prints key-value pairs representing a configuration's stored properties.--format="text" is meant for human inspection of multi-attribute objects, not direct assignment to single-value shell variables.A user needed to inspect the stored settings of a specific named configuration on screen and display all properties in a readable multi-line text list.
Answer them yourself and get your score the moment you finish. No account needed.
Full access includes
Keep the momentum going with these hand-picked practice scenarios
Last updated Validated