ionos-cloud / terraform-provider-ionoscloud

The IonosCloud Terraform provider gives the ability to deploy and configure resources using the IonosCloud APIs.
Mozilla Public License 2.0
34 stars 23 forks source link

ionoscloud_volume cannot be created without imagePassword #30

Closed larsen0815 closed 3 years ago

larsen0815 commented 3 years ago

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)
mflorin commented 3 years ago

@larsen0815 please check v5.2.1

larsen0815 commented 3 years ago

Works as expected now, thx!