2017-04-26 65 views
1

我有一个服务帐户,我希望能够“充当”(在AWS中称为“承担”)。如下图所示在我的项目我的所谓“斗观众服务帐户”服务帐户:如何让用户成为Google Cloud Platform(GCP)中的服务帐户的演员?

$ gcloud projects get-iam-policy myproject 
bindings: 
- members: 
    - serviceAccount:[email protected] 
    role: roles/editor 
- members: 
    - user:[email protected] 
    role: roles/owner 
- members: 
    - serviceAccount:[email protected] 
    role: roles/storage.objectViewer 
etag: BwVOE_CkjAo= 
version: 1 

我希望授予其他用户“充当”这个服务帐户和我已经申请了以下的能力,但没有得到很远:

$ gcloud iam service-accounts add-iam-policy-binding \ 
    [email protected] \ 
    --member='user:[email protected]' --role='roles/iam.serviceAccountActor' 
bindings: 
- members: 
    - user:user:[email protected] 
    role: roles/iam.serviceAccountActor 
etag: BwVOFAhEVqY= 

是所有我需要做的,使用户[email protected](一旦他们登录)可以访问现有的资源,以服务帐户?或者是否有另一个步骤需要用户“承担”服务帐户?

我已经浏览了许多关于初学者的文档Understanding Service Accounts的页面,但大多数人似乎都在考虑使用服务帐户的应用程序,其中文档明确提及用户,组织等可以使用服务帐户。

回答

0

iam.serviceAccountActor role使用户能够创建和管理使用服务帐户的计算引擎实例。

我可以误解的东西,但如果你想给别人的许可,直接充当服务帐户,最简单的方法很可能是create a private key文件,代表服务帐户特定用户充当该服务帐户,然后给他们那个私钥文件。

0

为用户提供“服务帐户演员”角色不会像您所建议的那样,以过渡方式授予访问权限。相反,它允许用户“使用”服务帐户来启动将该服务帐户作为标识的长时间运行的作业(例如,创建计算引擎实例)。

相关问题