Bitzu

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

Single choice

Which command creates a new named gcloud configuration?

  1. gcloud config set configuration NAME
  2. gcloud config configurations create NAME
  3. gcloud init --new NAME
  4. 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.

Select all that apply

Which properties are normally stored in a gcloud configuration?

  1. The default project
  2. compute/zone
  3. compute/region
  4. The amount of a billing budget
  5. 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

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.

Download on the App StoreGet it on Google Play

More Associate Cloud Engineer topics in this module