ionos-cloud/terraform-provider-ionoscloud

ionoscloud_volume cannot be created without imagePassword

larsen0815 opened this issue · 2 comments

Description

See issue #24: It is now possible to create a "ionoscloud_server" with a volume without defining "image_name".
However, it seems this doesn't apply to creating a "ionoscloud_volume".

main.tf:

resource "ionoscloud_volume" "swap" {
  datacenter_id = "${ionoscloud_datacenter.example.id}"
  server_id     = "${ionoscloud_server.JetBlue.id}"
  name           = "JetBlue Swap"
  size           = 4
  disk_type      = "HDD"
  licence_type="other"
}

On apply:

ionoscloud_volume.swap: Creating...
?
¦ Error: an error occured while creating a volume: 422 Unprocessable Entity: {
¦   "httpStatus" : 422,
¦   "messages" : [ {
¦     "errorCode" : "100",
¦     "message" : "[(root).properties.imagePassword] Attribute 'image' or 'imageAlias' must be set for password"
¦   }, {
¦     "errorCode" : "109",
¦     "message" : "[(root).properties.bus] Attribute value '' not allowed. Expected one of [IDE, VIRTIO]"
¦   }, {
¦     "errorCode" : "100",
¦     "message" : "[(root).properties.imagePassword] Password syntax error. Password invalid, valid characters are: a-zA-Z0-9. Length between 8 and 50."
¦   } ]
¦ }

Expected behavior

As "image_name" is not needed, neither should be "imagePassword". Not sure about "bus", this should probably default to "virtio".

Environment

Terraform v1.0.0
on linux_amd64
+ provider registry.terraform.io/ionos-cloud/ionoscloud v5.2.0
Debian GNU/Linux 10 (buster)

@larsen0815 please check v5.2.1

Works as expected now, thx!