0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

サービスアカウントを利用してCloud SDK ツールを使う

Last updated at Posted at 2019-03-12

gcloud auth login せずに gcloud を使用する場合、サービスアカウントを利用する方法があります。

サービスアカウントのJSONファイルは /root/your_service_account.json にあるものとします。

gcloud auth activate-service-account --key-file /root/your_service_account.json
gcloud config set project your_project

または、

export CLOUDSDK_CONFIG=/root/.config/gcloud
mkdir -p /root/.config/gcloud/configurations
echo "[auth]" > /root/.config/gcloud/configurations/config_default
echo "credential_file_override = /root/your_service_account.json" >> /root/.config/gcloud/configurations/config_default
gcloud config set project your_project

参考:https://github.com/GoogleCloudPlatform/cloud-sdk-docker/issues/152#event-1933393673

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?