An operations engineer requires permissions to restart and reset existing Compute Engine instances in a staging project after automated tests complete. The engineer must not be allowed to create new VM instances, delete persistent disks, or modify Virtual Private Cloud (VPC) network configurations. Which IAM role assignment complies with Google Cloud's principle of least privilege?
- Grant the Compute Operator (roles/compute.operator) role to the engineer at the project level.Answer
- BGrant the Editor (roles/editor) primitive role to the engineer at the project level.
- CGrant the Compute Admin (roles/compute.admin) role to the engineer at the project level.
- DGrant the Compute Viewer (roles/compute.viewer) role at the organization level so instance operations inherit down to the project.
Answer
Granting the Compute Operator (roles/compute.operator) role at the project level provides the precise permissions needed to reboot and reset VM instances while withholding instance creation, deletion, and networking administrative privileges.
The Compute Operator (roles/compute.operator) role grants permission to manage the state of Compute Engine instances (such as starting, stopping, and resetting them) without allowing users to create new instances, delete persistent disks, or reconfigure networking resources. This aligns directly with the principle of least privilege.
Step-by-Step Solution
Key Concept
Selecting predefined IAM roles to enforce least privilege for Compute Engine lifecycle management
Estimated Time:1m 30s