Hard1 markMultiple Choice

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

You need to create a Custom IAM Role because none of the predefined roles exactly match your security requirements. You want to create this role using a YAML file that defines the title, description, and included permissions.

Which command should you use to create the role at the project level?

Answer options:

A.

gcloud iam roles create [ROLE_ID] --project=[PROJECT_ID] --file=[YAML_FILE]

B.

gcloud projects add-iam-policy-binding [PROJECT_ID] --role=[YAML_FILE]

C.

kubectl apply -f [YAML_FILE]

D.

gcloud iam custom-roles apply [YAML_FILE]

How to approach this question

Identify the command for creating custom IAM roles.

Full Answer

A.gcloud iam roles create [ROLE_ID] --project=[PROJECT_ID] --file=[YAML_FILE]✓ Correct
To create a custom IAM role, you use the `gcloud iam roles create` command. You can specify the role properties directly via flags, or pass a YAML/JSON file containing the role definition using the `--file` flag. You must also specify whether the role is created at the `--project` or `--organization` level.

Common mistakes

Confusing role creation (`roles create`) with role assignment (`add-iam-policy-binding`).

Practice the full GCP Associate Cloud Engineer Practice Exam 4

50 questions · hints · full answers · grading

More questions from this exam