Medium1 markMultiple Choice
Domain 3.1: Deploying and implementing Compute Engine resourcesDomain 3Compute EnginegcloudService Accounts

GCP ACE · Question 19 · Domain 3.1: Deploying and implementing Compute Engine resources

You need to create a new Compute Engine instance using the gcloud CLI. The instance must run under a specific custom service account (app-sa@my-project.iam.gserviceaccount.com) and have access to the cloud-platform API scope.

Which gcloud command flags should you use?

Answer options:

A.

--service-account and --scopes

B.

--iam-account and --permissions

C.

--service-account and --roles

D.

--account and --api-access

How to approach this question

Recall the specific gcloud flags used to attach an identity and define API access levels for a Compute Engine VM.

Full Answer

A.--service-account and --scopes✓ Correct
When creating a VM with `gcloud compute instances create`, you use the `--service-account` flag to specify the email address of the service account. You use the `--scopes` flag to specify the OAuth2 scopes (like `https://www.googleapis.com/auth/cloud-platform`) that determine which GCP APIs the VM can call.

Common mistakes

Confusing IAM roles with API scopes. While best practice is to rely on IAM roles, the VM configuration specifically requires setting 'scopes'.

Practice the full GCP Associate Cloud Engineer Practice Exam 5

50 questions · hints · full answers · grading

More questions from this exam