0

我試圖使用appcfg.py update . --authenticate_service_account從GCE實例進行部署。無論我如何配置權限,我似乎總是得到Google Compute Engine權限和角色不會授予必要的作用域

RuntimeError: Required scopes ['https://www.googleapis.com/auth/appengine.admin', 'https://www.googleapis.com/auth/ 
userinfo.email'] missing from ['https://www.googleapis.com/auth/cloud-platform']. This VM instance probably needs t 
o be recreated with the missing scopes. 

我試着

  1. 實例與「Compute Engine的默認服務帳戶」與「允許完全訪問所有云API」打勾
  2. 實例與定製服務帳戶的角色「的App Engine部署」
  3. 實例與作用「App Engine管理」
定製服務帳戶10

如何創建具有必要範圍的GCE實例?

+0

好了,剛發現的範圍和角色之間的關係的一些文檔。問題是,當它被分配給一個服務帳戶時,你不能指定一個實例的作用域,你根本不能指定一個服務帳戶的作用域。這在GUI中至少是這樣。我會看看'gcloud'是否更有意義。 – brandones

+0

[上述文檔](https://cloud.google.com/compute/docs/access/service-accounts#accesscopesiam) – brandones

回答

0

作用域被棄用而傾向於角色,但轉換仍然不完整。在GUI中似乎不可能爲實例分配範圍和角色,這對於某些功能仍然是必需的。

解決方法是使用gcloud命令。它支持範圍但不支持角色。

我創造了我的實例管理的部署與

gcloud compute instances create deployer --zone us-east1-c --scopes bigquery,cloud-platform,datastore,logging-write,storage-full,taskqueue,useraccounts-ro,userinfo-email,monitoring-write,service-management,https://www.googleapis.com/auth/source.full_control,https://www.googleapis.com/auth/appengine.admin