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

ip_address not available as nutanix_virtual_machine attribute. #19

Closed
rmatinata opened this issue Jan 22, 2019 · 2 comments
Closed

ip_address not available as nutanix_virtual_machine attribute. #19

rmatinata opened this issue Jan 22, 2019 · 2 comments
Assignees
Labels
v1.1.0 Provider Version 1.1.0

Comments

@rmatinata
Copy link

Describe the bug
ip_address not available as nutanix_virtual_machine attribute.

output "ips" {
 value = "${join(",",nutanix_virtual_machine.simple-vm.*.ip_address)}"
}

Error: Error running plan: 1 error(s) occurred:

* output.ips: Resource 'nutanix_virtual_machine.simple-vm' does not have attribute 'ip_address' for variable 'nutanix_virtual_machine.simple-vm.*.ip_address'

Expected behavior
ip_address available as an attribute.

Versions (please complete the following information):

  • CentOS 7.x
  • Terraform 0.11.11
  • Nutanix Cluster 5.10.07
  • Nutanix Prism Central 5.10.07
  • Terraform provider version - compiled from master

Additional context

It seems that this problem was originated by this commit: 5315889

This creates a very serious problem since due to Terraform interpolation limitations (can't deal with complex nested lists), we can't really access IP addresses (such as for filling up templates), when creating VMs in bulk. The following construct would simply not work:

output "simple-vm-ips" {
  value = "${join(",",nutanix_virtual_machine.simple-vm.*.nic_list.0.ip_endpoint_list.0.ip)}"
}
@marinsalinas
Copy link
Contributor

Hello @rmatinata,

We know about the Terraform's interpolation syntax has limitations, we are figuring out how to solve this. The previous code (5315889) is no longer available since you could have more than one NICs attached with multiple IP endpoints. The following output code might work for you if you are trying to get the VM.

output "ip_address" {
  value = "${lookup(nutanix_virtual_machine.vm.nic_list.0.ip_endpoint_list[0], "ip")}"
}

For more information see: #17

@PacoDw
Copy link
Contributor

PacoDw commented Aug 10, 2020

To due to a inactivity of this issue we will close this ticket, if you still having similar issues like this, plz open a new one.

@PacoDw PacoDw closed this as completed Aug 10, 2020
yannickstruyf3 pushed a commit to yannickstruyf3/terraform-provider-nutanix that referenced this issue Nov 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v1.1.0 Provider Version 1.1.0
Projects
None yet
Development

No branches or pull requests

3 participants