Getting external IP of created google instance for a particular interface using terraform

Viewed 531

I am using terraform to create and configure my GCE instance. I have configured 4 interfaces on the GCE interface, Now i want the external IP of the managenment interface using terraform for this instance .

For aws , we have some concept of

output "ip" {
  value = "${aws_eip.ip.public_ip}"
}

so i was wondering if i could use GCE equivalent for this . In short I want to store the external IP of the created instance on my local instance preferably in a variable

1 Answers

I used output variable to get IP computed during instance creation

output "mgt0ip" {
  value = "${google_compute_instance.default.network_interface.0.access_config.0.nat_ip}"
}
Related