Get an IP address of node in vmware


I am creating nodes in vmware using vsphere provider and need to get the IP address of the nodes that has been created. Nodes are getting IP after they have booted up and got IPs from DHCP. After a few minutes in vCenter console i can see it’s IP address. Therefore I wonder how can I get this IP in Terraform to use it for other purposes like setting up a hostname in DNS.

you could try terraform show to show all the metadata available, and then check which property can be “exported” using an “output” variable (if you want it on screen), or just use it in your DNS provider TF resource, if the DNS provider is supported as well! :slight_smile:

Thanks! that showed a lot of stuff and in particular interesting one was default_ip_address which show the IP I was interested in.

1 Like

create an output that shows that value, if you’re deploying multiple machines you can output a list of values.