Question 39 of 500

Quick Answer

The correct answer is to attach a service account to the Compute Engine instance with appropriate roles for Cloud SQL and Cloud Storage. This works because the instance’s attached service account enables the application to automatically obtain short-lived credentials from the metadata server at 169.254.169.254, eliminating the need to store or distribute long-lived service account keys. On the Google Professional Cloud Security Engineer exam, this scenario tests your understanding of how Compute Engine service account short-lived credentials integrate with IAM and application default credentials, a core concept for secure keyless authentication. A common trap is assuming a custom service account key must be generated and stored on the instance, which violates the security requirement. Remember the memory tip: “Attach, don’t stash” — attach the service account to the VM rather than stashing a key file, and the metadata server handles the rest.

PCSE Practice Question: Configuring access within a cloud solution environment

This PCSE practice question tests your understanding of configuring access within 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.

A financial services company is migrating its on-premises application to Google Cloud. The application needs to access a Cloud SQL instance and a Cloud Storage bucket. Security requirements mandate that the application must use short-lived credentials and avoid storing long-lived service account keys. The application runs on Compute Engine. What should the Security Engineer do to meet these requirements?

Question 1hardmultiple 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 to the Compute Engine instance with appropriate roles for Cloud SQL and Cloud Storage.

Option C is correct because attaching a service account directly to a Compute Engine instance allows the application to automatically obtain short-lived access tokens from the instance metadata server (http://169.254.169.254) for accessing Cloud SQL and Cloud Storage. This approach eliminates the need to store long-lived service account keys, meeting the security requirement for short-lived credentials.

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.

  • Create a service account and use Workload Identity Federation to impersonate it.

    Why it's wrong here

    Workload Identity Federation is for external identities, not needed for Compute Engine.

  • Use Cloud Key Management Service to generate and rotate keys for the service account.

    Why it's wrong here

    This still requires a long-lived key.

  • Attach a service account to the Compute Engine instance with appropriate roles for Cloud SQL and Cloud Storage.

    Why this is correct

    Compute Engine automatically obtains short-lived tokens via the metadata server.

    Related concept

    Read the scenario before looking for a memorised answer.

  • Create a service account key and store it in Cloud Secret Manager.

    Why it's wrong here

    Service account keys are long-lived and violate the requirement.

Common exam traps

Common exam trap: answer the scenario, not the keyword

Google Cloud often tests the distinction between Compute Engine's native service account attachment (which provides short-lived tokens via metadata server) and external identity federation methods, leading candidates to incorrectly choose Workload Identity Federation for internal workloads.

Detailed technical explanation

How to think about this question

When a service account is attached to a Compute Engine instance, the instance's metadata server provides OAuth 2.0 access tokens with a default lifetime of 1 hour (configurable up to 12 hours). The application can use these tokens to authenticate to Google Cloud APIs via the gRPC or REST endpoints. This mechanism relies on the instance's identity and the IAM roles granted to the service account, ensuring credentials are automatically rotated and never persisted on disk.

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 PCSE 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 PCSE 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 PCSE question test?

Configuring access within a cloud solution environment — This question tests Configuring access within 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 to the Compute Engine instance with appropriate roles for Cloud SQL and Cloud Storage. — Option C is correct because attaching a service account directly to a Compute Engine instance allows the application to automatically obtain short-lived access tokens from the instance metadata server (http://169.254.169.254) for accessing Cloud SQL and Cloud Storage. This approach eliminates the need to store long-lived service account keys, meeting the security requirement for short-lived credentials.

What should I do if I get this PCSE 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

Same concept, more angles

1 more ways this is tested on PCSE

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. Which two authentication methods are available for applications to authenticate to Google Cloud APIs without using a service account key? (Choose TWO.)

easy
  • A.API key
  • B.Compute Engine metadata server default service account token
  • C.OAuth 2.0 client ID
  • D.Workload Identity Federation
  • E.Service account key

Why B: Option B is correct because the Compute Engine metadata server provides a default service account token that applications running on Compute Engine can use to authenticate to Google Cloud APIs without needing to manage a service account key file. This token is automatically obtained from the metadata server at http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token, and it is rotated automatically by Google, eliminating the need for key storage and rotation.

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 PCSE 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 PCSE exam.