Google Associate Cloud Engineer Question 342
Select 2Google Cloud PlatformYou are the Google Cloud administrator for your organization. The security team has requested that a new IAM role be created to allow users to only view the configurations of Compute Engine instances without allowing them to start or stop instances. Which of the following steps should you take to achieve this?
- A
Create a new custom role with the 'compute.instances.get' permission.
- B
Assign the 'Viewer' predefined role to the users.
- C
Create a new custom role with the 'compute.instances.list' permission.
- D
Create a new custom role with the 'compute.instances.start' and 'compute.instances.stop' permissions.
- E
Use the 'Compute Viewer' predefined role.
Show answer and explanation
Correct answers: A, C
Explanation
To fulfill the requirement of allowing users to view Compute Engine instance configurations without the ability to start or stop them, a custom role should include the 'compute.instances.get' and 'compute.instances.list' permissions. These permissions enable users to access details of instances and list them, which aligns with the viewing requirement. Other roles or permissions either provide broader access or include actions not needed for this task.
- A. Correct.
The 'compute.instances.get' permission allows users to view the configurations of specific Compute Engine instances, which is necessary for the requirement.
- B. Incorrect.
The 'Viewer' predefined role grants permissions to view resources across all services, not just Compute Engine, which might be more than needed.
- C. Correct.
The 'compute.instances.list' permission allows users to list all Compute Engine instances in a project, which is necessary to view configurations.
- D. Incorrect.
The 'compute.instances.start' and 'compute.instances.stop' permissions allow users to start and stop instances, which is not required for viewing configurations.
- E. Incorrect.
The 'Compute Viewer' predefined role includes permissions beyond just viewing configurations and might allow more actions than required.