I see in the list of Supported Resource Types that Google Cloud Deployment Manager has at least some support for the storage.v1.object
type. I'm hoping this gives me the ability to write files to GCS based on data in my DM template. I'm stuck, though, on how to even compose the properties for the resource in a way that DM likes. When I use the following template:
resources:
- name: foo.txt
type: storage.v1.object
properties:
bucket: my-bucket
name: foo.txt
uploadType: media
I get the following error from gcloud deployment-manager
:
ERROR: (gcloud.deployment-manager.deployments.update) Error in Operation [operation-1522258413242-5687c67fa4691-c89f17c6-c0b96018]: errors:
- code: RESOURCE_ERROR
location: /deployments/test-serviceaccount/resources/foo.txt
message: '{"ResourceType":"storage.v1.object","ResourceErrorCode":"400","ResourceErrorMessage":{"code":400,"errors":[{"domain":"global","message":"Upload
requests must include an uploadType URL parameter and a URL path beginning with
/upload/","reason":"wrongUrlForUpload","extendedHelp":"https://cloud.google.com/storage/docs/json_api/v1/how-tos/upload"}],"message":"Upload
requests must include an uploadType URL parameter and a URL path beginning with
/upload/","statusMessage":"Bad Request","requestPath":"https://www.googleapis.com/storage/v1/b/my-bucket/o","httpMethod":"POST"}}'
What am I missing here? How do I construct a valid storage.v1.object
resource in a Deployment Manager template?