Topic 1 Question 30
2 つ選択You have recently been put in charge of managing identity and access management for your organization. You have several projects and want to use scripting and automation wherever possible. You want to grant the editor role to a project member. Which two methods can you use to accomplish this?
GetIamPolicy() via REST API
setIamPolicy() via REST API
gcloud pubsub add-iam-policy-binding Sprojectname --member user:Susername --role roles/editor
gcloud projects add-iam-policy-binding Sprojectname --member user:Susername --role roles/editor
Enter an email address in the Add members field, and select the desired role from the drop-down menu in the GCP Console.
ユーザの投票
コメント(17)
Correct Answer are (D) & (E)
GetIamPolicy and SetIamPolicy is only for service accounts. But question asks for a project members. Hence, D and E are correct ans. D - https://cloud.google.com/iam/docs/granting-changing-revoking-access#granting-gcloud-manual E - https://cloud.google.com/iam/docs/granting-changing-revoking-access#access-control-via-console
👍 18ESP_SAP2020/11/01A) GetIamPolicy() would not do anything by itself but see (B) B) would require use of GetIamPolicy() as otherwise SetIamPolicy() override existing binding C) obviously wrong, question is not about pubsub D) the documentation indicate that project_id need to be used not project_name, would therefore return an error E) would work, despite being very vague, but is not automation.
Now, the question ask for "which 2 methods can be used to achieve that".
Both GetIamPolicy() and SetIamPolicy() are programatic methods that if used together could achieve that.
Therefore one could roll with A&B in the spirits of that very tricky question.
👍 8EranSolstice2021/10/21Ans - DE
👍 7[Removed]2020/11/20
シャッフルモード