Question 445 of 500
Setting up a cloud solution environmentmediumMultiple ChoiceObjective-mapped

Quick Answer

The answer is to attach a service account with the Storage Object Viewer role to the GCE VM. This is the recommended authentication approach because the VM’s metadata server automatically provides OAuth 2.0 access tokens for the attached service account, allowing the application to authenticate to Cloud Storage without embedding or managing any credentials in the code. On the Google Associate Cloud Engineer exam, this scenario tests your understanding of identity-based access over key-based access; a common trap is choosing to generate and store a JSON key file on the VM, which is less secure and not recommended. Remember that the metadata server handles token refresh automatically, so your application code only needs to call the default credentials. Memory tip: “Attach, don’t stash” — attach the role to the VM, never stash a key file on the instance.

Google ACE Setting up a cloud solution environment Practice Question

This ACE practice question tests your understanding of setting up a cloud solution environment. Read the scenario carefully and evaluate each option against the stated constraints before committing to an answer. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

An application running on a Compute Engine VM needs to read objects from a Cloud Storage bucket in the same project. What is the recommended authentication approach?

Question 1mediummultiple choice
Full question →

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Attach a service account with the Storage Object Viewer role to the VM

Option B is correct because attaching a service account with the Storage Object Viewer role to the Compute Engine VM is the recommended and secure method for authenticating to Cloud Storage. The VM automatically obtains OAuth 2.0 access tokens for the service account via the metadata server, eliminating the need to manage or embed credentials in the application code.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Embed a developer's user account credentials in the application configuration file

    Why it's wrong here

    Embedding user credentials is a serious security risk — credentials can leak and are tied to a human account rather than the application.

  • Attach a service account with the Storage Object Viewer role to the VM

    Why this is correct

    Service accounts attached to VMs allow applications to authenticate automatically via the metadata server. This eliminates the need to manage credentials directly.

    Related concept

    Read the scenario before looking for a memorised answer.

  • Create an API key and store it as an environment variable on the VM

    Why it's wrong here

    API keys are not recommended for server-to-server authentication and do not support fine-grained IAM access control for Cloud Storage.

  • Grant the VM's IP address access to the bucket using a VPC firewall rule

    Why it's wrong here

    Firewall rules control network traffic — they do not grant IAM permissions to access Cloud Storage resources.

Common exam traps

Common exam trap: answer the scenario, not the keyword

Google Cloud often tests the misconception that API keys or IP-based firewall rules can control access to Cloud Storage, when in fact Cloud Storage relies solely on IAM roles and OAuth 2.0 tokens for authentication and authorization.

Detailed technical explanation

How to think about this question

Under the hood, the Compute Engine metadata server exposes a service account token endpoint at `http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token`. The Google Cloud Storage client libraries automatically fetch and refresh OAuth 2.0 tokens from this endpoint, using the default service account or a custom one attached to the VM. This approach avoids hardcoding secrets and supports automatic token rotation, which is critical for long-running applications or those that scale across many instances.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

A media company stores terabytes of video archives that are accessed once a year for audit purposes. Moving these objects to a cold storage tier (Azure Archive, S3 Glacier, or Google Nearline) costs a fraction of hot storage. Questions like this test whether you understand storage tiers, access frequency tradeoffs, and retrieval latency requirements.

What to study next

Got this wrong? Here's your next step.

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Related practice questions

Related ACE practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free ACE practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this ACE question test?

Setting up a cloud solution environment — This question tests Setting up a cloud solution environment — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: Attach a service account with the Storage Object Viewer role to the VM — Option B is correct because attaching a service account with the Storage Object Viewer role to the Compute Engine VM is the recommended and secure method for authenticating to Cloud Storage. The VM automatically obtains OAuth 2.0 access tokens for the service account via the metadata server, eliminating the need to manage or embed credentials in the application code.

What should I do if I get this ACE question wrong?

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Last reviewed: Jun 30, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This ACE practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the ACE exam.