Get current Public IP address

If you need to get the current ip of the machine that runs the terraform script, use the following declarations:

data "http" "myip" {
  url = "http://ipv4.icanhazip.com"
}

output "myip" {
  value = "${chomp(data.http.myip.body)}/32"
}