Problem with virtual network cluster in Terraform

Hello.
Terrafom always tries change a cluster in virtual network:

  ~ resource "opennebula_virtual_network" "test_network" {
      + clusters        = (known after apply)

I’ve added parameter “cluster” to a Terraform config file:


  clusters = {
    id = "0"
  }

But got the error:
Inappropriate value for attribute “clusters”: list of number required.

How can decide the problem?

sounds like you need to define that as a list. your example is a string, so something like this might work:

clusters = {
    id = [
            "0"
          ]
  }

Hello.
Thank you for reply.
But in this case the same problem(

│ Error: Incorrect attribute value type
│ 
│   on networks.tf line 20, in resource "opennebula_virtual_network" "test_network":
│   20:   clusters = {
│   21:     id = [
│   22:       "0"
│   23:     ]
│   24:   }
│ 
│ Inappropriate value for attribute "clusters": list of number required.

ah, try not quoting the number. quoting it makes it a string.

The same problem(

│ Error: Incorrect attribute value type
│ 
│   on networks.tf line 20, in resource "opennebula_virtual_network" "test_network":
│   20:   clusters = {
│   21:     id = [
│   22:       0
│   23:     ]
│   24:   }
│ 
│ Inappropriate value for attribute "clusters": list of number required.

maybe the docs are wrong. from the provider test source, it looks like just a list of numbers. try that.

You are right.
Thank you so much