Cross project management using service account

大城市里の小女人 提交于 2019-11-28 06:50:01
Zachary Newman

You should be able to add a service account to another project:

  1. Create the first service account in project A in the Cloud Console. Activate it using gcloud auth activate-service-account.

  2. In the Cloud Console, navigate to project B. Find the "IAM & admin" > "IAM" page. Click the "Add" button. In the "New members" field paste the name of the service account (it should look like a strange email address) and give it the appropriate role.

  3. Run gcloud commands with --project set to project B. They should succeed (I just manually verified that this will work).

Automatic creation of service accounts is something that we're hesitant to do until we can work through all of the security ramifications.

I know its a bit old, but if anyone is still looking for this,To add to @Zachary Newman answer, To make things clear, After you created a service account in project A you should go to project B to "IAM" (not "Service Accounts"), There you will be able to add the email you just created with proper roles.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!