diff --git a/google/resource_storage_bucket_object.go b/google/resource_storage_bucket_object.go index 2c87b6c8..cef1b3d8 100644 --- a/google/resource_storage_bucket_object.go +++ b/google/resource_storage_bucket_object.go @@ -149,6 +149,12 @@ func resourceStorageBucketObject() *schema.Resource { Type: schema.TypeString, Computed: true, }, + + // https://github.com/hashicorp/terraform/issues/19052 + "output_name": { + Type: schema.TypeString, + Computed: true, + }, }, } } @@ -241,6 +247,7 @@ func resourceStorageBucketObjectRead(d *schema.ResourceData, meta interface{}) e d.Set("content_type", res.ContentType) d.Set("storage_class", res.StorageClass) d.Set("self_link", res.SelfLink) + d.Set("output_name", res.Name) d.SetId(objectGetId(res)) diff --git a/website/docs/r/storage_bucket_object.html.markdown b/website/docs/r/storage_bucket_object.html.markdown index 790a5e74..832eb76e 100644 --- a/website/docs/r/storage_bucket_object.html.markdown +++ b/website/docs/r/storage_bucket_object.html.markdown @@ -34,7 +34,7 @@ The following arguments are supported: * `bucket` - (Required) The name of the containing bucket. -* `name` - (Required) The name of the object. +* `name` - (Required) The name of the object. If you're interpolating the name of this object, see `output_name` instead. One of the following is required: @@ -71,3 +71,6 @@ exported: * `md5hash` - (Computed) Base 64 MD5 hash of the uploaded data. * `self_link` - (Computed) A url reference to this object. + +* `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.