Migrating from gcloud CLI Config
This reference is the agent's decision guide for users coming from the gcloud CLI. There is no
standalone prose tutorial for this migration yet -- for the full auth configuration schema, see
Atmos Auth configuration and its
providers and
identities reference pages.
Identifying the User's Shape
| User has... | Maps to |
|---|---|
Run gcloud auth application-default login | Application Default Credentials |
| CI/CD already configured for Workload Identity Federation | CI / Workload Identity Federation |
gcloud config set auth/impersonate_service_account, or scripts that pass --impersonate-service-account | Service Account Impersonation |
gcloud config set project / gcloud config configurations | Project/Region Defaults |
A downloaded service-account JSON key file (GOOGLE_APPLICATION_CREDENTIALS=key.json) | No Direct Equivalent: Static Key Files |
Command Equivalence
| Old gcloud CLI workflow | atmos auth equivalent |
|---|---|
gcloud auth login (gcloud's own credential store, not ADC) | Not relevant to atmos auth -- Atmos never reads gcloud's own credential store, only the ADC file (see the gotcha below) |
gcloud auth application-default login | Still a required one-time prerequisite -- gcp/adc reads the resulting ADC file but doesn't perform this login itself. Run it once, then use atmos auth login -i x for the rest |
gcloud config set project / gcloud config configurations activate x | No manual step -- the identity's principal.project_id selects this automatically |
gcloud auth print-access-token | No direct equivalent -- atmos auth whoami -i x shows identity/account info, not a raw bearer token; nothing in Atmos prints one to stdout today |
Running gcloud ... / terraform ... under a specific config | atmos auth exec -i x -- gcloud ... or atmos auth shell -i x |
Manual export GOOGLE_APPLICATION_CREDENTIALS=... scripts | eval $(atmos auth env -i x) |
Shells, exec, and Your Default gcloud Config
By default, Atmos does not read or write your system's default gcloud config
(~/.config/gcloud/). Same two recommended patterns as everywhere else in Atmos Auth:
atmos auth shell -i <identity>-- subshell with that identity's credentials active.atmos auth exec -i <identity> -- <command>-- one-off command with credentials injected.
If the user wants gcloud/terraform/other tools to "just work" in their normal shell without a
subshell wrapper, eval $(atmos auth env -i <identity>) redirects the standard GCP SDK env vars
(GOOGLE_APPLICATION_CREDENTIALS, CLOUDSDK_CONFIG, GOOGLE_CLOUD_PROJECT) to Atmos-managed
files. The user's actual
~/.config/gcloud/application_default_credentials.json and gcloud named configurations are never
touched; Atmos just points the current shell at its own managed credential files instead. Safe to
add to .bashrc/.zshrc -- doesn't trigger a login prompt by itself.
Application Default Credentials → gcp/adc
Before:
gcloud auth application-default login
This writes ~/.config/gcloud/application_default_credentials.json, which gcp/adc reads.
After (atmos.yaml):
auth:providers:gcp-adc:kind: gcp/adcproject_id: my-gcp-project # optional: overrides gcloud config defaultregion: us-central1 # optionalscopes: # optional- https://www.googleapis.com/auth/cloud-platform
Gotcha: plain gcloud auth login (no application-default) only populates gcloud's own
credential store, not the ADC file Atmos reads. If atmos auth login fails with a
credentials-not-found error right after a user swears they "already logged in," this is almost
always why -- have them run gcloud auth application-default login specifically.
CI / Workload Identity Federation → gcp/workload-identity-federation
Before: a GitHub Actions job using google-github-actions/auth with
workload_identity_provider and service_account inputs (no static JSON key).
After (atmos.yaml):
auth:providers:gcp-wif:kind: gcp/workload-identity-federationproject_number: "123456789012" # required, numericworkload_identity_pool_id: github-poolworkload_identity_provider_id: github-providerservice_account_email: ci-sa@my-project.iam.gserviceaccount.com
In GitHub Actions, Atmos auto-detects the OIDC token source (ACTIONS_ID_TOKEN_REQUEST_URL/
ACTIONS_ID_TOKEN_REQUEST_TOKEN) -- don't hand-configure token_source unless running outside
GitHub Actions (e.g., a different CI system posting its own OIDC token to a URL or file).
Service Account Impersonation → gcp/service-account
Before:
gcloud config set auth/impersonate_service_account terraform@my-project.iam.gserviceaccount.com# or per-command: gcloud ... --impersonate-service-account=terraform@my-project.iam.gserviceaccount.com
After (atmos.yaml):
auth:identities:terraform:kind: gcp/service-accountdefault: truevia:provider: gcp-adc # or gcp-wif for CIprincipal:service_account_email: terraform@my-project.iam.gserviceaccount.comlifetime: 3600s # optional, default 1h, max 12h -- note the trailing "s"
This requires the base identity (the user or the WIF principal) to already hold
roles/iam.serviceAccountTokenCreator on the target service account -- the same IAM binding
gcloud --impersonate-service-account needed. lifetime values above 3600s also require the
org to have the target service account allowlisted under the
iam.allowServiceAccountCredentialLifetimeExtension organization policy constraint -- without it,
Google's API rejects the extended lifetime and token generation fails.
Project/Region Defaults → gcp/project
Before:
gcloud config set project production-projectgcloud config set compute/region us-central1
After (atmos.yaml):
auth:identities:prod-project:kind: gcp/projectvia:provider: gcp-adcprincipal:project_id: production-projectregion: us-central1zone: us-central1-a # optional
Multiple gcloud config configurations (gcloud config configurations create <name>) become
multiple gcp/project or gcp/service-account identities under one shared provider -- mark
whichever the user activates most often as default: true.
No Direct Equivalent: Static Service-Account Key Files
There is no provider or identity kind that loads a downloaded service-account JSON key
(GOOGLE_APPLICATION_CREDENTIALS pointing at a file with a private_key field). This is
deliberate, not a gap to apologize for: frame it to the user as a security improvement. Recommend
gcp/adc (interactive) or gcp/workload-identity-federation (CI) as the base identity, plus
gcp/service-account impersonation for the target service account, and retiring the downloaded
key from GCP IAM once the migration is verified -- impersonation avoids ever holding exportable
long-lived key material.
Common Gotchas
gcloud auth loginvsgcloud auth application-default login-- only the latter feedsgcp/adc. This is the most common first-run failure.gcp/service-accountneedsroles/iam.serviceAccountTokenCreatoron the target SA for the base identity -- a missing grant here shows up as a 403, not a config error.gcp/oidcis not an available provider kind. Don't suggest it.lifetimetakes a duration-with-suffix string ("3600s"), not a bare integer.
Related Skills
Atmos Auth configuration for the full provider/identity schema, and atmos auth commands for the command reference.