Add a computed name field to google_storage_bucket_object (#2914)

<!-- This change is generated by MagicModules. -->
/cc @rileykarson
This commit is contained in:
The Magician 2019-01-23 13:17:33 -08:00 committed by Riley Karson
parent 62fe98fb0a
commit c8abf0ce03
2 changed files with 11 additions and 1 deletions

View File

@ -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))

View File

@ -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.