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
abhimutant added a commit that referenced this issue Dec 9, 2024
* Feat/1.9.3 (#633)

Co-authored-by: Abhishekism9450 <[email protected]>
Co-authored-by: Deepak Muley <[email protected]>
Co-authored-by: Abhishek <[email protected]>

* Feat/1.9.4 (#645)

Co-authored-by: Frederic M <[email protected]>
Co-authored-by: ArtemProt <[email protected]>
Co-authored-by: Abhishekism9450 <[email protected]>

* new tf design

* import changes

* package name change for fc

* package name for fc is foundationCentral

* package name to foundationcentral

* fixes around acctest

* examples folder

* v4 design

* some fixes after merging

* datasource for subnets,vpcs, fips

* resource for subnets

* adding go mod for public repo

* lint fixes

* lint fix

* lint fix for client name

* test config as client will be different for sdks

* adding crud for fips

* test for subnet

* docs for subnet

* tcs for fips

* lint fixes

* lint fix in fips

* lint fix

* docs for fip

* docs and tcs for vpc

* delete vendor and exclude vendor folder

* change the subnets, floating_ip and vpc module name from v4 to v2, add examples

* fix acc test cases for resource services

* fix acc test cases for datasource services, use internal sdk, create the resources that test cases needed within the test case itself

* change package name from networking to networkingv2

* Revert "delete vendor and exclude vendor folder"

This reverts commit 34ac198.

* Feat/v4 pbrs  on v4 networks  (#13)

* datasource for pbrs

* lint fixes. go error (gomnd, gosimple, golint)

* go checks, magic numbers(gomnd)

* fix config testcase as base client will differ in sdks

* tests and docs for pbrs

* change module  name from v4 to v2

* change package  name to networkingv2

* add pbr_v2 example

* fix import

---------

Co-authored-by: Abhishek <[email protected]>

* Feat/v4 static routes on v4 networks  (#14)

* datasource for pbrs

* lint fixes. go error (gomnd, gosimple, golint)

* go checks, magic numbers(gomnd)

* fix config testcase as base client will differ in sdks

* datasourc for route tables

* resource for static route

* tests and docs for pbrs

* docs for route table

* docs for static route

* lint fixes

* remove other services

* change module name from v4 to v2

* change package name to networkingv2

* change package name to networkingv2

* remove other services

---------

Co-authored-by: Abhishek <[email protected]>

* Feat/v4 network security rules on v4 networks  (#15)

* datasource for pbrs

* lint fixes. go error (gomnd, gosimple, golint)

* go checks, magic numbers(gomnd)

* fix config testcase as base client will differ in sdks

* datasourc for route tables

* resource for static route

* address groups v4

* service groups

* resource for service groups

* crud for service groups

* CRUD for address groups

* data source for network security

* CRUD for network security

* tests and docs for pbrs

* docs for route table

* docs for static route

* lint fixes

* testcases for address groups

* fixing lint issues

* lint fix

* docs for address groups

* test and docs for service groups

* docs and tcs for NSP

* resource tests for NSP

* tcs for NSP

* remove other services

* change module name from v4 to v2

* change package name to networkingv2

---------

Co-authored-by: Abhishek <[email protected]>

* Feat/v4 address group on v4 networks  (#16)

* datasource for pbrs

* lint fixes. go error (gomnd, gosimple, golint)

* go checks, magic numbers(gomnd)

* fix config testcase as base client will differ in sdks

* datasourc for route tables

* resource for static route

* address groups v4

* service groups

* resource for service groups

* crud for service groups

* CRUD for address groups

* tests and docs for pbrs

* docs for route table

* docs for static route

* lint fixes

* testcases for address groups

* fixing lint issues

* lint fix

* docs for address groups

* test and docs for service groups

* add examples for address group and service group

* add examples for address group and service group

* add examples for address group and service group

* Revert "add examples for address group and service group"

This reverts commit 4c1cc92f031ae60a97604a17a374fd2930b21acb.

* remove other modules

* change module name from v4 to v2

* change package name from v2

---------

Co-authored-by: Abhishek <[email protected]>

---------

Co-authored-by: Abhishek Chaudhary <[email protected]>
Co-authored-by: Abhishekism9450 <[email protected]>
Co-authored-by: Deepak Muley <[email protected]>
Co-authored-by: Abhishek <[email protected]>
Co-authored-by: Frederic M <[email protected]>
Co-authored-by: ArtemProt <[email protected]>
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