Googe Cloud: Service Account access for every project

I've a server, where I use the gcloud command for monitoring purposes. Previously I used the gcloud auth login for authentication, but now I'd like to use a more secure method with service accounts. I stopped my VM, create a service account with Owner roles, but when I use the gcloud project list, I only see the currenct project. But I have 3 other projects, how can I access every project with a service account?

1
задан 11 April 2018 в 13:56
1 ответ

Для этого необходимо активировать служебную учетную запись с помощью [1]:

$ gcloud auth activate-service-account --key-file=[KEY:JSON]

и инициализировать команду gcloud с помощью [2]:

$ gcloud init

[1] https://cloud. google.com/sdk/gcloud/reference/auth/activate-service-account [2] https://cloud.google.com/sdk/gcloud/reference/init

1
ответ дан 3 December 2019 в 23:18

Теги

Похожие вопросы