Skip to content

Commit

Permalink
add device_name attribute to ucloud_disk_attachment (#163)
Browse files Browse the repository at this point in the history
* add device_name attribute to ucloud_disk_attachment

* Add change log
  • Loading branch information
wangrzneu authored Mar 8, 2024
1 parent aa70aaf commit 99c71fb
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
## v1.38.7 (2024-03-08)

FEATURES:

* `resource/ucloud_disk_attachment`: add `device_name` attribute.

## v1.38.6 (2024-02-26)

BUG FIXES:

* `resource/ucloud_instance`: ignore min_cpu_platform change from null to Intel/Auto

## v1.38.5 (2024-02-26)

BUG FIXES:

* `resource/ucloud_instance`: add a default value of min_cpu_platform

## v1.38.4 (2024-02-01)

BUG FIXES:

* `resource/ucloud_instance`: fix panic issue while detaching disk in a host

## 1.38.3 (2023-11-22)

BUG FIXES:
Expand Down
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 99c71fb

Please sign in to comment.