From b589ab17389ca618822a1ae28ba8b90a3dd3165c Mon Sep 17 00:00:00 2001 From: Ian Gudger Date: Mon, 3 Aug 2020 17:05:27 -0700 Subject: [PATCH] Add google_storage_bucket_object.media_link. (#6897) Fixes #6894 --- google/data_source_google_storage_bucket_object.go | 1 + google/resource_storage_bucket_object.go | 7 +++++++ website/docs/d/storage_bucket_object.html.markdown | 2 ++ website/docs/r/storage_bucket_object.html.markdown | 2 ++ 4 files changed, 12 insertions(+) diff --git a/google/data_source_google_storage_bucket_object.go b/google/data_source_google_storage_bucket_object.go index 8c3f8ae1232..c548c972af0 100644 --- a/google/data_source_google_storage_bucket_object.go +++ b/google/data_source_google_storage_bucket_object.go @@ -49,6 +49,7 @@ func dataSourceGoogleStorageBucketObjectRead(d *schema.ResourceData, meta interf d.Set("self_link", res["selfLink"]) d.Set("storage_class", res["storageClass"]) d.Set("md5hash", res["md5Hash"]) + d.Set("media_link", res["mediaLink"]) d.Set("metadata", res["metadata"]) d.SetId(bucket + "-" + name) diff --git a/google/resource_storage_bucket_object.go b/google/resource_storage_bucket_object.go index bbe85b682d5..bb58cc30a54 100644 --- a/google/resource_storage_bucket_object.go +++ b/google/resource_storage_bucket_object.go @@ -171,6 +171,12 @@ func resourceStorageBucketObject() *schema.Resource { Computed: true, Description: `The name of the object. Use this field in interpolations with google_storage_object_acl to recreate google_storage_object_acl resources when your google_storage_bucket_object is recreated.`, }, + + "media_link": { + Type: schema.TypeString, + Computed: true, + Description: `A url reference to download this object.`, + }, }, } } @@ -269,6 +275,7 @@ func resourceStorageBucketObjectRead(d *schema.ResourceData, meta interface{}) e d.Set("self_link", res.SelfLink) d.Set("output_name", res.Name) d.Set("metadata", res.Metadata) + d.Set("media_link", res.MediaLink) d.SetId(objectGetId(res)) diff --git a/website/docs/d/storage_bucket_object.html.markdown b/website/docs/d/storage_bucket_object.html.markdown index c948b127dfa..689abebebe4 100644 --- a/website/docs/d/storage_bucket_object.html.markdown +++ b/website/docs/d/storage_bucket_object.html.markdown @@ -59,3 +59,5 @@ The following attributes are exported: * `storage_class` - (Computed) The [StorageClass](https://cloud.google.com/storage/docs/storage-classes) of the new bucket object. Supported values include: `MULTI_REGIONAL`, `REGIONAL`, `NEARLINE`, `COLDLINE`. If not provided, this defaults to the bucket's default storage class or to a [standard](https://cloud.google.com/storage/docs/storage-classes#standard) class. + +* `media_link` - (Computed) A url reference to download this object. diff --git a/website/docs/r/storage_bucket_object.html.markdown b/website/docs/r/storage_bucket_object.html.markdown index fef95aeec0f..a982bd34ee8 100644 --- a/website/docs/r/storage_bucket_object.html.markdown +++ b/website/docs/r/storage_bucket_object.html.markdown @@ -76,3 +76,5 @@ exported: * `output_name` - (Computed) The name of the object. Use this field in interpolations with `google_storage_object_acl` to recreate `google_storage_object_acl` resources when your `google_storage_bucket_object` is recreated. + +* `media_link` - (Computed) A url reference to download this object.