0
0
GCPcloud~10 mins

Scripting with gcloud 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 Compute Engine instances in the current project.

GCP
gcloud compute instances [1]
Drag options to blanks, or click blank then click option'
Alist
Bcreate
Cdelete
Ddescribe
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'create' instead of 'list' will try to make a new instance.
Using 'delete' will remove instances, which is not what we want.
Using 'describe' shows details of one instance, not all.
2fill in blank
medium

Complete the code to set the default project for gcloud commands.

GCP
gcloud config [1] project my-project-id
Drag options to blanks, or click blank then click option'
Aunset
Bset
Cget
Dlist
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'unset' removes a config value.
Using 'get' only reads the current value.
Using 'list' shows all config values.
3fill in blank
hard

Fix the error in the command to create a new Compute Engine instance named 'web-server'.

GCP
gcloud compute instances create [1] --zone=us-central1-a
Drag options to blanks, or click blank then click option'
Aweb-server
Bwebserver
Cweb_server
Dweb server
Attempts:
3 left
💡 Hint
Common Mistakes
Using spaces in the name causes errors.
Underscores are not valid for instance names.
Concatenated words without separator are allowed but less readable.
4fill in blank
hard

Fill both blanks to create a firewall rule named 'allow-http' that allows TCP traffic on port 80.

GCP
gcloud compute firewall-rules create [1] --allow [2]
Drag options to blanks, or click blank then click option'
Aallow-http
Btcp:80
Cudp:80
Dallow-ssh
Attempts:
3 left
💡 Hint
Common Mistakes
Using UDP instead of TCP for HTTP traffic.
Using a rule name that doesn't match the allowed traffic.
Forgetting to specify the port.
5fill in blank
hard

Fill all three blanks to list all storage buckets in the project 'my-project' with JSON output format.

GCP
gcloud [1] [2] list --project=[3] --format=json
Drag options to blanks, or click blank then click option'
Astorage
Bbuckets
Cmy-project
Dinstances
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'instances' instead of 'buckets' for storage.
Omitting the project flag or using wrong project name.
Not specifying the output format correctly.