1

我已經使用Google Cloud Deployment Manager創建了一個存儲桶(請參閱下文),但權限部分被忽略,我找不到任何使用Google時設置IAM的示例雲部署管理器。你能幫我嗎?Google Cloud Deployment Manager:如何在創建存儲桶時設置IAM

resources: 
    - name: {{ env["name"] }} 
     type: storage.v1.bucket 
     properties: 
     kind: storage#bucket 
     location: eu 
     storageClass: MULTI_REGIONAL 
     iam-policy: 
      bindings: 
      - role: roles/storage.objectViewer 
      members: 
      - allUsers 

回答

0

有2個訪問級別可以設置 - 桶級別&對象級別。試試這樣的:

resources: 
    - name: {{ env["name"] }} 
     type: storage.v1.bucket 
     properties: 
     kind: storage#bucket 
     location: eu 
     storageClass: MULTI_REGIONAL 
     acl: 
     - role: READER 
      entity: allUsers # maybe allAuthenticatedUsers? 
     defaultObjectAcl: 
     - entity: allUsers # maybe allAuthenticatedUsers? 
      role: READER 
相關問題