Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ar not valid parameter for opennebula_virtual_network #66

Closed
bdeetz opened this issue Oct 19, 2020 · 2 comments
Closed

ar not valid parameter for opennebula_virtual_network #66

bdeetz opened this issue Oct 19, 2020 · 2 comments
Assignees
Milestone

Comments

@bdeetz
Copy link

bdeetz commented Oct 19, 2020

When I define a virtual network like the following:

resource "opennebula_virtual_network" "team_21_isp" {
  name = "team_21_isp"

  permissions = "660"
  group = "opennebula-admins"

  physical_device = "vlan1121"
  type = "bridge"
  gateway = "10.72.21.1"
  mtu = 9000

  security_groups = [ 0 ]

  clusters = [ 103 ]

  tags = {
    environment = "team21"
  }

  ar = [ {
           ar_type = "IP4",
           size = 253,
           ip4 = "10.72.22.2"
  } ]
}

I receive the following:

Error: Unsupported argument

  on main.tf line 41, in resource "opennebula_virtual_network" "team_21_isp":
  41:   ar = [ {

An argument named "ar" is not expected here. Did you mean "id"?

My terraform version is 0.13.4 with opennebula provider version 0.2.2. I see in the following provider code that ar is supposed to be a valid parameter. So I'm really not sure what's going on here. https://github.com/OpenNebula/terraform-provider-opennebula/blob/v0.2.2/opennebula/resource_opennebula_virtual_network.go#L179

@jaypif
Copy link
Collaborator

jaypif commented Oct 20, 2020

Hi,

ar is a terraform list.
You should use it without brackets like this.

ar {
           ar_type = "IP4",
           size = 253,
           ip4 = "10.72.22.2"
  }

The doc is wrong I will fix it. thanks

Can you retry ?

It should work

@bdeetz
Copy link
Author

bdeetz commented Oct 20, 2020

Close. There should not be commas between the arguments.

Error: Unexpected comma after argument

  on main.tf line 51, in resource "opennebula_virtual_network" "team_isp":
  51:            ar_type = "IP4",

The following worked:

  ar {
           ar_type = "IP4"
           size = 253
           ip4 = "10.72.${count.index}.2"
  }

jaypif added a commit that referenced this issue Oct 20, 2020
This commit also fix the doc issue observed in #66
@jaypif jaypif mentioned this issue Oct 20, 2020
@jaypif jaypif added this to the 0.3.0 milestone Oct 21, 2020
@jaypif jaypif self-assigned this Oct 21, 2020
jaypif added a commit that referenced this issue Oct 26, 2020
This commit also fix the doc issue observed in #66
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants