dmacvicar / terraform-provider-libvirt

Terraform provider to provision infrastructure with Linux's KVM using libvirt
Apache License 2.0
1.54k stars 457 forks source link

Documentation issue — An argument named "disk" is not expected here. Did you mean to define a block of type "disk"? #1032

Open alexs77 opened 9 months ago

alexs77 commented 9 months ago

System Information

Linux distribution

Red Hat Enterprise Linux release 8.8 (Ootpa)

Terraform version

$ terraform -v
Terraform v1.5.7
on linux_amd64
+ provider registry.terraform.io/dmacvicar/libvirt v0.7.1

Provider and libvirt versions

$ .terraform/providers/registry.terraform.io/dmacvicar/libvirt/0.7.1/linux_amd64/terraform-provider-libvirt_v0.7.1 -version
.terraform/providers/registry.terraform.io/dmacvicar/libvirt/0.7.1/linux_amd64/terraform-provider-libvirt_v0.7.1 0.7.1

Checklist

Description of Issue/Question

Setup

terraform {
  required_providers {
    libvirt = {
      source  = "dmacvicar/libvirt"
      version = "0.7.1"
    }
  }
}

provider "libvirt" {
  uri = "qemu:///system"
}

resource "libvirt_domain" "default" {
  name        = "example"

  disk = [
    {
      volume_id = libvirt_volume.volume1.id
    },
      {
      volume_id = libvirt_volume.volume2.id
    }
  ]
}

Steps to Reproduce Issue

Per the libvirt_domain documentation, the disk = […] should be correct. However, terraform plan throws an error:

$ terraform plan
╷
│ Error: Unsupported argument
│
│   on main.tf line 17, in resource "libvirt_domain" "default":
│   17:     disk = [
│
│ An argument named "disk" is not expected here. Did you mean to define a block of type "disk"?
╵

I'm referring to this part of the documentation.

Handling disks

The same issue might also be true for eg. cmdline. Have not checked this.


Additional information:

n/a