我想知道是否可以附加在中创建的服务帐户
我的项目A
到一个谷歌计算引擎实例
我的项目B
?
以下命令:
gcloud beta compute instances create my-instance \
--service-account=my-service-account@my-project-a.iam.gserviceaccount.com \
--scopes=https://www.googleapis.com/auth/cloud-platform \
--project=my-project-b
给出以下错误:
(gcloud.beta.compute.instances.create) Could not fetch resource:
- The user does not have access to service account 'my-service-account@my-project-a.iam.gserviceaccount.com'. User: 'me@mysite.com'. Ask a project owner to grant you the iam.serviceAccountUser role on the service account. me@mysite.com is my account and I'm the owner of the org.
不确定这是否相关,但查看用户界面(在
我的项目B
)没有从任何其他项目添加服务帐户的选项。我希望能添加帐户
我的-service-account@my-project-a.iam.gsserviceaccount.com