dmacvicar / terraform-provider-libvirt

Terraform provider to provision infrastructure with Linux's KVM using libvirt
Apache License 2.0
1.6k stars 460 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 1 year ago

alexs77 commented 1 year 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

scabala commented 3 months ago

I think this is currently fixed - could you verify and close the issue if it is?

alexs77 commented 2 months ago

image

this section is still there in the documentation, as of 2024-09-04 05:04 UTC.

Referring to this part:

resource "libvirt_domain" "my_machine" {
  ...
  disk = [
    {
      volume_id = libvirt_volume.volume1.id
    },
    {
      volume_id = libvirt_volume.volume2.id
    }
  ]
}

I cannot currently check whether that's working or not.

scabala commented 2 months ago

Ah yes, I see it know - documentation is not consistent, thanks for point that one out.