diff --git a/third_party/terraform/data_sources/data_source_google_storage_bucket_object.go b/third_party/terraform/data_sources/data_source_google_storage_bucket_object.go index 8c3f8ae12326..c548c972af0a 100644 --- a/third_party/terraform/data_sources/data_source_google_storage_bucket_object.go +++ b/third_party/terraform/data_sources/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/third_party/terraform/resources/resource_storage_bucket_object.go b/third_party/terraform/resources/resource_storage_bucket_object.go index bbe85b682d55..bb58cc30a542 100644 --- a/third_party/terraform/resources/resource_storage_bucket_object.go +++ b/third_party/terraform/resources/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/third_party/terraform/website/docs/d/storage_bucket_object.html.markdown b/third_party/terraform/website/docs/d/storage_bucket_object.html.markdown index c948b127dfa5..689abebebe49 100644 --- a/third_party/terraform/website/docs/d/storage_bucket_object.html.markdown +++ b/third_party/terraform/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/third_party/terraform/website/docs/r/storage_bucket_object.html.markdown b/third_party/terraform/website/docs/r/storage_bucket_object.html.markdown index fef95aeec0fe..a982bd34ee88 100644 --- a/third_party/terraform/website/docs/r/storage_bucket_object.html.markdown +++ b/third_party/terraform/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.