Skip to content

Commit 99c71fb

Browse files
authored
add device_name attribute to ucloud_disk_attachment (#163)
* add device_name attribute to ucloud_disk_attachment * Add change log
1 parent aa70aaf commit 99c71fb

File tree

3 files changed

+37
-1
lines changed

3 files changed

+37
-1
lines changed

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
## v1.38.7 (2024-03-08)
2+
3+
FEATURES:
4+
5+
* `resource/ucloud_disk_attachment`: add `device_name` attribute.
6+
7+
## v1.38.6 (2024-02-26)
8+
9+
BUG FIXES:
10+
11+
* `resource/ucloud_instance`: ignore min_cpu_platform change from null to Intel/Auto
12+
13+
## v1.38.5 (2024-02-26)
14+
15+
BUG FIXES:
16+
17+
* `resource/ucloud_instance`: add a default value of min_cpu_platform
18+
19+
## v1.38.4 (2024-02-01)
20+
21+
BUG FIXES:
22+
23+
* `resource/ucloud_instance`: fix panic issue while detaching disk in a host
24+
125
## 1.38.3 (2023-11-22)
226

327
BUG FIXES:

ucloud/resource_ucloud_disk_attachment.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ func resourceUCloudDiskAttachment() *schema.Resource {
4343
Type: schema.TypeBool,
4444
Optional: true,
4545
},
46+
47+
"device_name": {
48+
Type: schema.TypeString,
49+
Computed: true,
50+
},
4651
},
4752
}
4853
}
@@ -100,6 +105,7 @@ func resourceUCloudDiskAttachmentRead(d *schema.ResourceData, meta interface{})
100105
d.Set("availability_zone", d.Get("availability_zone").(string))
101106
d.Set("instance_id", resourceSet.UHostId)
102107
d.Set("disk_id", resourceSet.UDiskId)
108+
d.Set("device_name", resourceSet.DeviceName)
103109

104110
return nil
105111
}

website/docs/r/disk_attachment.html.markdown

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,10 @@ The following arguments are supported:
5959
* `instance_id` - (Required, ForceNew) The ID of instance.
6060
* `disk_id` - (Required, ForceNew) The ID of disk that needs to be attached
6161
* `stop_instance_before_detaching` - (Optional, Boolean) Set this to true to ensure that the target instance is stopped
62-
before trying to detach the volume.
62+
before trying to detach the volume.
63+
64+
## Attributes Reference
65+
66+
In addition to all arguments above, the following attributes are exported:
67+
68+
* `device_name` - The device name to expose to the instance, for example `vdb`.

0 commit comments

Comments
 (0)