Skip to content

Commit

Permalink
Add a computed name field to google_storage_bucket_object (#2914)
Browse files Browse the repository at this point in the history
<!-- This change is generated by MagicModules. -->
/cc @rileykarson
  • Loading branch information
modular-magician authored and rileykarson committed Jan 23, 2019
1 parent 62fe98f commit c8abf0c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 7 additions & 0 deletions google/resource_storage_bucket_object.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
},
}
}
Expand Down Expand Up @@ -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))

Expand Down
5 changes: 4 additions & 1 deletion website/docs/r/storage_bucket_object.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -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.

0 comments on commit c8abf0c

Please sign in to comment.