Skip to content

Commit

Permalink
add device_name attribute to ucloud_disk_attachment
Browse files Browse the repository at this point in the history
  • Loading branch information
wangrzneu committed Mar 8, 2024
1 parent aa70aaf commit 611ff76
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions ucloud/resource_ucloud_disk_attachment.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ func resourceUCloudDiskAttachment() *schema.Resource {
Type: schema.TypeBool,
Optional: true,
},

"device_name": {
Type: schema.TypeString,
Computed: true,
},
},
}
}
Expand Down Expand Up @@ -100,6 +105,7 @@ func resourceUCloudDiskAttachmentRead(d *schema.ResourceData, meta interface{})
d.Set("availability_zone", d.Get("availability_zone").(string))
d.Set("instance_id", resourceSet.UHostId)
d.Set("disk_id", resourceSet.UDiskId)
d.Set("device_name", resourceSet.DeviceName)

return nil
}
Expand Down
8 changes: 7 additions & 1 deletion website/docs/r/disk_attachment.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,10 @@ The following arguments are supported:
* `instance_id` - (Required, ForceNew) The ID of instance.
* `disk_id` - (Required, ForceNew) The ID of disk that needs to be attached
* `stop_instance_before_detaching` - (Optional, Boolean) Set this to true to ensure that the target instance is stopped
before trying to detach the volume.
before trying to detach the volume.

## Attributes Reference

In addition to all arguments above, the following attributes are exported:

* `device_name` - The device name to expose to the instance, for example `vdb`.

0 comments on commit 611ff76

Please sign in to comment.