ASSOCIATE-CLOUD-ENGINEER · Question #73
Which is the correct command to bind an IAM policy to a service account at an organisation or folder level?
The correct answer is A. gcloud organizations add-iam-policy-binding org_id --member serviceAccount:whizlab@amazon-. This question asks for the correct gcloud command to bind an IAM policy to a service account at the organization or folder level.
Question
Options
- Agcloud organizations add-iam-policy-binding org_id --member serviceAccount:whizlab@amazon-
- Bgcloud projects add-iam-policy-binding amazon-prj --member serviceAccount:amazonamazon-
- Cgcloud iam service-accounts keys create amazon-prj --iam-account amazon@amazon-
- Dgcloud organizations add-iam-policy-binding --member serviceAccount:whizlab@amazon-
How the community answered
(58 responses)- A86% (50)
- B3% (2)
- C2% (1)
- D9% (5)
Why each option
This question asks for the correct gcloud command to bind an IAM policy to a service account at the organization or folder level.
The command `gcloud organizations add-iam-policy-binding` is used to grant an IAM role to a member at the organization level, requiring the organization ID and specifying the service account as the member in the format `serviceAccount:email`.
`gcloud projects add-iam-policy-binding` is used to bind policies at the project level, not the organization or folder level.
`gcloud iam service-accounts keys create` is used to create a service account key, not to bind an IAM policy.
This command is missing the organization ID (`org_id`) which is a required positional argument to specify which organization the policy binding applies to.
Concept tested: GCP IAM Policy Binding Organizations
Source: https://cloud.google.com/sdk/gcloud/reference/organizations/add-iam-policy-binding
Topics
Community Discussion
No community discussion yet for this question.