Skip to content

Commit fa7664e

Browse files
Add google_storage_bucket_object.media_link (#3803) (#2331)
Co-authored-by: Ian Gudger <[email protected]> Signed-off-by: Modular Magician <[email protected]> Co-authored-by: Ian Gudger <[email protected]>
1 parent 4d856ec commit fa7664e

File tree

5 files changed

+15
-0
lines changed

5 files changed

+15
-0
lines changed

.changelog/3803.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
storage: added output-only `media_link` to `google_storage_bucket_object`
3+
```

google-beta/data_source_google_storage_bucket_object.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ func dataSourceGoogleStorageBucketObjectRead(d *schema.ResourceData, meta interf
4949
d.Set("self_link", res["selfLink"])
5050
d.Set("storage_class", res["storageClass"])
5151
d.Set("md5hash", res["md5Hash"])
52+
d.Set("media_link", res["mediaLink"])
5253
d.Set("metadata", res["metadata"])
5354

5455
d.SetId(bucket + "-" + name)

google-beta/resource_storage_bucket_object.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,12 @@ func resourceStorageBucketObject() *schema.Resource {
171171
Computed: true,
172172
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.`,
173173
},
174+
175+
"media_link": {
176+
Type: schema.TypeString,
177+
Computed: true,
178+
Description: `A url reference to download this object.`,
179+
},
174180
},
175181
}
176182
}
@@ -269,6 +275,7 @@ func resourceStorageBucketObjectRead(d *schema.ResourceData, meta interface{}) e
269275
d.Set("self_link", res.SelfLink)
270276
d.Set("output_name", res.Name)
271277
d.Set("metadata", res.Metadata)
278+
d.Set("media_link", res.MediaLink)
272279

273280
d.SetId(objectGetId(res))
274281

website/docs/d/storage_bucket_object.html.markdown

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,5 @@ The following attributes are exported:
5959
* `storage_class` - (Computed) The [StorageClass](https://cloud.google.com/storage/docs/storage-classes) of the new bucket object.
6060
Supported values include: `MULTI_REGIONAL`, `REGIONAL`, `NEARLINE`, `COLDLINE`. If not provided, this defaults to the bucket's default
6161
storage class or to a [standard](https://cloud.google.com/storage/docs/storage-classes#standard) class.
62+
63+
* `media_link` - (Computed) A url reference to download this object.

website/docs/r/storage_bucket_object.html.markdown

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,5 @@ exported:
7676

7777
* `output_name` - (Computed) The name of the object. Use this field in interpolations with `google_storage_object_acl` to recreate
7878
`google_storage_object_acl` resources when your `google_storage_bucket_object` is recreated.
79+
80+
* `media_link` - (Computed) A url reference to download this object.

0 commit comments

Comments
 (0)