2

I'm trying to create a bucket using GCP Deployment Manager. I already went through the QuickStart guide and was able to create a compute.v1.instance. But I'm trying to create a bucket in Google Cloud Storage, but am unable to get anything other than 403 Forbidden.

This is what my template file looks like.

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

This is what I'm calling

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

And this is what I'm receiving back

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"}'>]>

I have credentials setup, and I even created an account owner set of credentials (which can access everything) and I'm still getting this response.

Any ideas or good places to look? Is it my config or do I need to pass additional credentials in my request?

I'm coming from an AWS background, still finding my way around GCP.

Thanks

stu
  • 175
  • 7

1 Answers1

2

Buckets on Google Cloud Platform need to be unique. If you try to create a bucket with a name that is already used by somebody else (on another project), you will receive an ERROR MESSAGE. I would test by creating a new bucket with another name.

Fematich
  • 1,588
  • 14
  • 26
  • I just made this generic for the post. I'm using a unique name. The uniqueness of the name wouldn't send back a 403. – stu Sep 24 '16 at 19:01
  • Did you check the correct name conventions (listed [here](https://cloud.google.com/storage/docs/naming))? [The Google Cloud Storage documentation on error codes](https://cloud.google.com/storage/docs/json_api/v1/status-codes#403_Forbidden) indicates that you don't have correct rights to make this call. Did you try to make the same bucket using the [Cloud Console](https://console.cloud.google.com/)? – Fematich Sep 24 '16 at 19:07
  • 2
    Thanks for your patience. You were right, I was using the name `tf-composite-frontend-angular` which I thought would be a sufficient combination for uniqueness. I just tried to create it manually and it failed saying it was not unique. So I've appended a `-1` and it works. Thanks again. (sigh) – stu Sep 24 '16 at 21:07