terraform-provider-huaweicloud
terraform-provider-huaweicloud copied to clipboard
Add huaweicloud_compute_volume_attach ordering capacity
Current Terraform Version
1.5.1
Use-cases
When creating Terraform Modules for ECS instances, every now and then I have to use huaweicloud_compute_volume_attach to attach data disks to the VMs and usually I want this to be attached on a certain order e.g. Disk1 128Gb and Disk2 512 Gb, currently it's impossible to determine which order the disks will get attached to the VM.
Attempted Solutions
This is the code I'm currently using on my terraform module
variable "dataDiskSize" {
default = [{ size = 128, type = "SAS" },{ size = 512, type = "SAS" }]
}
....
resource "huaweicloud_compute_volume_attach" "diskattachment" {
count = length(var.dataDiskSize)
instance_id = huaweicloud_compute_instance.genericLinux.id
volume_id = element(huaweicloud_evs_volume.dataDisk[*].id, count.index)
}
Proposal
Please add a property to allow order control while attaching the disk to the vm