Medium1 markMultiple Choice

GCP ACE · Question 42 · Domain 5.1: Managing Identity and Access Management (IAM)

Your security team has requested that a specific automated script be granted permission to start and stop Compute Engine instances, but absolutely nothing else. You review the predefined IAM roles and find that none of them match this exact set of permissions without granting additional access.

What should you do?

Answer options:

A.

Assign the roles/compute.instanceAdmin.v1 role.

B.

Create a custom IAM role containing only the compute.instances.start and compute.instances.stop permissions.

C.

Assign the primitive Editor role.

D.

Modify an existing predefined role to remove the unwanted permissions.

How to approach this question

Recognize when to use Custom IAM roles (when predefined roles grant too much or too little access).

Full Answer

B.Create a custom IAM role containing only the compute.instances.start and compute.instances.stop permissions.✓ Correct
When predefined roles do not meet your specific security requirements (e.g., they grant too many permissions), the best practice is to create a Custom IAM role. You can select the exact permissions needed (`compute.instances.start` and `compute.instances.stop`) and assign that custom role to the script's service account.

Common mistakes

Thinking you can edit predefined roles, or settling for a broader predefined role that violates least privilege.

Practice the full GCP Associate Cloud Engineer Practice Exam 3

50 questions · hints · full answers · grading

More questions from this exam