【问题标题】:Creating a bucket using Google Cloud Platform Deployment Manager Template使用 Google Cloud Platform Deployment Manager 模板创建存储桶
【发布时间】:2017-02-02 09:44:24
【问题描述】:

我正在尝试使用 GCP 部署管理器创建存储桶。我已经阅读了快速入门指南并且能够创建一个compute.v1.instance。但我正在尝试在 Google Cloud Storage 中创建一个存储桶,但除了403 Forbidden 之外,我无法获得任何其他信息。

这就是我的模板文件的样子。

resources:
- type: storage.v1.bucket
  name: test-bucket
  properties:
    project: my-project
    name: test-bucket-name

这就是我所说的

gcloud deployment-manager deployments create deploy-test --config deploy.yml

这就是我收到的回复

Waiting for create operation-1474738357403-53d4447edfd79-eed73ce7-cabd72fd...failed.
ERROR: (gcloud.deployment-manager.deployments.create) Error in Operation operation-1474738357403-53d4447edfd79-eed73ce7-cabd72fd: <ErrorValue
 errors: [<ErrorsValueListEntry
 code: u'RESOURCE_ERROR'
 location: u'deploy-test/test-bucket'
 message: u'Unexpected response from resource of type storage.v1.bucket: 403 {"code":403,"errors":[{"domain":"global","message":"Forbidden","reason":"forbidden"}],"message":"Forbidden","statusMessage":"Forbidden","requestPath":"https://www.googleapis.com/storage/v1/b/test-bucket"}'>]>

我已经设置了凭据,我什至创建了一组帐户所有者凭据(可以访问所有内容),但我仍然收到此响应。

有什么想法或好去处吗?是我的配置还是我需要在我的请求中传递其他凭据?

我来自 AWS 背景,仍然在 GCP 中找到自己的方法。

谢谢

【问题讨论】:

    标签: google-cloud-storage google-cloud-platform gcp


    【解决方案1】:

    Google Cloud Platform 上的存储分区必须是唯一的。 如果您尝试创建一个名称已被其他人(在另一个项目中)使用的存储桶,您将收到一条错误消息。我将通过创建一个具有其他名称的新存储桶来进行测试。

    【讨论】:

    • 我只是为这篇文章做了这个通用的。我正在使用一个唯一的名称。名称的唯一性不会返回 403。
    • 您是否检查了正确的命名约定(列出的here)? The Google Cloud Storage documentation on error codes 表示您没有正确的权限进行此调用。您是否尝试使用Cloud Console 制作相同的存储桶?
    • 感谢您的耐心等待。你是对的,我使用的名称是 tf-composite-frontend-angular,我认为这对于唯一性来说是一个足够的组合。我只是尝试手动创建它,但没有说它不是唯一的。所以我附加了一个-1 并且它有效。再次感谢。 (叹气)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-07-07
    • 2015-02-15
    • 1970-01-01
    • 1970-01-01
    • 2017-05-23
    • 2020-09-19
    相关资源
    最近更新 更多