gcloud config configurations: Named CLI Profiles
gcloud config configurations manages named sets of CLI settings so you can switch project, account, and region in one step.
A pipeline that touches several projects or environments benefits from named configurations. Each bundles account, project, and region, and you activate one at a time.
What it does
gcloud config configurations create makes a named configuration; activate switches the active one; list shows all of them. Each configuration stores its own core/account, core/project, and regional defaults independently.
Common usage
gcloud config configurations create staging
gcloud config configurations activate staging
gcloud config set project my-staging-proj
gcloud config set run/region us-central1
gcloud config configurations listFlags
| Subcommand | What it does |
|---|---|
| create <name> | Create and switch to a new configuration |
| activate <name> | Make a configuration the active one |
| list | List all configurations and which is active |
| describe <name> | Show the properties of a configuration |
| delete <name> | Remove a configuration |
In CI
On a shared runner, set CLOUDSDK_CONFIG to a job-scoped temp directory so parallel jobs do not clobber each other configuration; that isolates credentials per job better than switching named configurations on one shared config dir.
Common errors in CI
"The configuration [name] does not exist" means a typo or it was never created. "You cannot delete property [project] ... it is set in the active configuration" indicates you must unset or switch first. Two parallel jobs sharing one CLOUDSDK_CONFIG can race and read each other settings; isolate with per-job CLOUDSDK_CONFIG.