Associate Cloud Engineer ยท Billing, locations and environment tooling
gcloud CLI and Cloud Shell
Installing and initializing gcloud, named configurations, setting default project/region/zone, authentication (user vs service account), Cloud Shell, and where gcloud, bq and kubectl fit.
Key points
- Set up the gcloud CLI with gcloud init, which signs you in and picks defaults.
- Configuration: named set of properties (account, project, compute/region, compute/zone).
- gcloud config configurations create / activate: create or switch one.
- gcloud config set sets values; --configuration overrides for one command.
- Cloud Shell: browser terminal with gcloud, 5 GB persistent home directory; the VM is temporary.
Source: https://docs.cloud.google.com/sdk/docs/configurations
Practice questions
Which command creates a new named gcloud configuration?
- gcloud config set configuration NAME
- gcloud config configurations create NAME
- gcloud init --new NAME
- gcloud auth configurations add NAME
Show answer
Answer: B. gcloud config configurations create NAME
gcloud config configurations create NAME creates it. gcloud config set changes a property in the active configuration instead.
Which properties are normally stored in a gcloud configuration?
- The default project
- compute/zone
- compute/region
- The amount of a billing budget
- The size of the Cloud Shell disk
Show answer
Answer: A. The default project, B. compute/zone, C. compute/region
Default project, compute region and compute zone are configuration properties set with gcloud config set. A budget amount and Cloud Shell disk size are not gcloud properties.
True or false: software you install outside your home directory in Cloud Shell is still there in your next session.
Show answer
Answer: False
False. The VM is temporary; only the persistent $HOME directory survives between sessions.
Practice 8 questions on this topic in Bitzu
Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.
