0
0
GCPcloud~10 mins

Service account keys management 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 create a new service account key using gcloud CLI.

GCP
gcloud iam service-accounts keys create key.json --iam-account=[1]
Drag options to blanks, or click blank then click option'
Amy-service-account@example.iam.gserviceaccount.com
Bservice-account-key
Cdefault
Dmy-project-id
Attempts:
3 left
💡 Hint
Common Mistakes
Using project ID instead of service account email
Using a generic name instead of the full email
2fill in blank
medium

Complete the command to list all keys for a service account.

GCP
gcloud iam service-accounts keys list --iam-account=[1]
Drag options to blanks, or click blank then click option'
Amy-service-account@example.iam.gserviceaccount.com
Bmy-project-id
Cdefault
Dkey.json
Attempts:
3 left
💡 Hint
Common Mistakes
Using project ID instead of service account email
Using a file name instead of the service account email
3fill in blank
hard

Fix the error in the command to delete a service account key by specifying the correct key ID.

GCP
gcloud iam service-accounts keys delete [1] --iam-account=my-service-account@example.iam.gserviceaccount.com
Drag options to blanks, or click blank then click option'
Adefault
Bmy-service-account@example.iam.gserviceaccount.com
Ckey.json
D1234567890abcdef
Attempts:
3 left
💡 Hint
Common Mistakes
Using the key file name instead of key ID
Using the service account email as key ID
4fill in blank
hard

Fill both blanks to create a new service account key and save it to a specific file.

GCP
gcloud iam service-accounts keys create [1] --iam-account=[2]
Drag options to blanks, or click blank then click option'
Anew-key.json
Bmy-project-id
Cmy-service-account@example.iam.gserviceaccount.com
Dkey.json
Attempts:
3 left
💡 Hint
Common Mistakes
Using project ID instead of service account email
Using a generic file name without extension
5fill in blank
hard

Fill all three blanks to list keys, filter by key type, and delete a specific key.

GCP
gcloud iam service-accounts keys list --iam-account=[1] --filter='keyType:[2]' && gcloud iam service-accounts keys delete [3] --iam-account=[1]
Drag options to blanks, or click blank then click option'
Amy-service-account@example.iam.gserviceaccount.com
BUSER_MANAGED
C1234567890abcdef
DSYSTEM_MANAGED
Attempts:
3 left
💡 Hint
Common Mistakes
Using system-managed instead of user-managed key type
Using project ID instead of service account email
Using file name instead of key ID for deletion