GCP Associate Cloud Engineer Practice Question

Several Compute Engine VMs were launched months ago with the project's default service account, which still holds the Editor role. Security has created a least-privilege user-managed service account named analytics-sa@project-id. The running VMs must start using this new identity without having to be rebuilt. What should an engineer do to attach the new service account to each VM instance?

  • Run gcloud compute instances update to modify the access configuration and specify the new service account while the VM keeps running.

  • Grant the VM's default service account the same IAM roles as analytics-sa@project-id; no changes to the instances are required.

  • Stop the VM, run gcloud compute instances set-service-account INSTANCE --service-account=analytics-sa@project-id --scopes=needed-scopes, then start the VM.

  • Copy a JSON key for analytics-sa@project-id onto each VM and set the GOOGLE_APPLICATION_CREDENTIALS environment variable.

GCP Associate Cloud Engineer
Configuring access and security
Your Score:
Settings & Objectives
Random Mixed
Questions are selected randomly from all chosen topics, with a preference for those you haven’t seen before. You may see several questions from the same objective or domain in a row.
Rotate by Objective
Questions cycle through each objective or domain in turn, helping you avoid long streaks of questions from the same area. You may see some repeat questions, but the distribution will be more balanced across topics.

Check or uncheck an objective to set which questions you will receive.

Bash, the Crucial Exams Chat Bot
AI Bot