Google cloud storage 403尝试使用部署管理器创建存储桶时禁止

Google cloud storage 403尝试使用部署管理器创建存储桶时禁止,google-cloud-storage,google-deployment-manager,google-cloud-iam,Google Cloud Storage,Google Deployment Manager,Google Cloud Iam,我正在尝试使用部署管理器通过以下资源配置创建GCS存储桶: resources: - type: storage.v1.bucket name: upload-bucket properties: project: <project-id> name: <unique-bucket-name> 角色205531008256@cloudservices.gserviceaccount.com默认情况下,Project Editor肯定有足够的权限吗

我正在尝试使用部署管理器通过以下资源配置创建GCS存储桶:

resources:
- type: storage.v1.bucket
  name: upload-bucket
  properties:
    project: <project-id>
    name: <unique-bucket-name>
角色205531008256@cloudservices.gserviceaccount.com默认情况下,Project Editor肯定有足够的权限吗?不过,我也尝试添加了存储管理员和项目所有者,两者似乎都没有帮助

我的两个问题是:

它为什么尝试使用此服务帐户? 如何让部署管理器能够创建一个bucket?
谢谢

请尝试此代码,我认为您指定了两次名称

resources:
- type: storage.v1.bucket
  name: <unique-bucket-name>
  properties:
    project: <project-id>

我遇到了完全相同的问题。请允许我更清楚地重申安德烈斯的回答

当你写信的时候

resources:
- type: storage.v1.bucket
  name: upload-bucket
  properties:
    project: <project-id>
    name: <unique-bucket-name>

您可能打算创建一个名为upload bucket的bucket,并认为upload bucket只是在部署管理器中引用该bucket的一个名称。GCP实际做的是尝试使用upload bucket作为实际的bucket名称。据我所知,它从未被使用过。这导致了一个问题,因为其他人已经拥有bucket upload bucket。

我最近遇到了类似的问题,部署管理器无法创建bucket

我已核实:

权限不是问题,因为同一部署包含已创建的其他bucket。 bucket名称不是问题,因为我可以手动创建bucket。 在谷歌搜索之后,我发现还有其他方法可以创建这个桶。除了使用type:storage.v1.bucket,还可以使用type:gcp-types/storage-v1:bucket

因此,我的最终解决方案是创建如下桶:

- name: images-bucket
  type: gcp-types/storage-v1:buckets
  properties:
    name: images-my-project-name
    location: "eu"

这是我最初尝试的,它给出了相同的错误。代码应按原样工作,确保使用唯一的bucket名称,也可以尝试删除项目属性或在代码示例中的项目id下方添加storageclass属性[storageclass:MULTI_REGIONAL]我建议您在答案中添加代码片段并引用它。提到安德烈是正确的,但你无法控制其他答案,这是值得称赞的。这个答案可能会被编辑或删除,然后你的答案的上下文就被破坏了。做出这样的改变,@me和我会投票支持你的答案,因为这肯定会增加清晰度。@Rodger。完成。非常感谢。
- name: images-bucket
  type: gcp-types/storage-v1:buckets
  properties:
    name: images-my-project-name
    location: "eu"