0
0
GCPcloud~10 mins

Cloud Shell and gcloud CLI in GCP - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to list all active projects using gcloud CLI.

GCP
gcloud [1] list
Drag options to blanks, or click blank then click option'
Aprojects
Bconfig
Cauth
Dcreate
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'create' instead of 'projects' will try to create a project, not list them.
Using 'config' or 'auth' commands won't list projects.
2fill in blank
medium

Complete the code to set the default project in gcloud CLI.

GCP
gcloud config set [1] my-project-id
Drag options to blanks, or click blank then click option'
Aaccount
Bproject
Czone
Dregion
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'account' sets the user account, not the project.
Using 'zone' or 'region' sets location, not the project.
3fill in blank
hard

Fix the error in the command to authenticate gcloud CLI with your Google account.

GCP
gcloud [1] login
Drag options to blanks, or click blank then click option'
Aprojects
Bconfig
Cauth
Dinit
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'config login' is invalid.
Using 'projects login' is invalid.
Using 'init' starts configuration but is not the direct login command.
4fill in blank
hard

Fill both blanks to create a new Compute Engine VM instance named 'my-vm' in zone 'us-central1-a'.

GCP
gcloud compute instances [1] my-vm --zone=[2]
Drag options to blanks, or click blank then click option'
Acreate
Bdelete
Cus-central1-a
Dus-east1-b
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'delete' instead of 'create' will remove instances.
Using the wrong zone will cause errors or create VM in a different location.
5fill in blank
hard

Fill all three blanks to list all VM instances in the project with detailed information and filter by zone 'europe-west1-b'.

GCP
gcloud compute instances list --filter="zone:[1]" --format=[2] --project=[3]
Drag options to blanks, or click blank then click option'
Aus-central1-a
Btable
Cmy-project-id
Deurope-west1-b
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong zone filter will show no or wrong results.
Omitting the project ID may cause errors if default project is not set.
Using incorrect format will change output style.