Closed cosmindev closed 3 years ago
Output variables in the format of unnecessarily multidimensional arrays which are hard to query by other tf code using this module:
output "public_ip" { description = "Public IPs of created instances. " value = ["${module.instance.public_ip}"] }
public_ip = [ [ "132.145.XX.YY", "132.145.XX.YY", ], ]
provisioner "file" { connection { user = "opc" agent = false private_key = "${chomp(file(var.ssh_private_key_path))}" timeout = "10m" host = "${module.instance.public_ip[count.index]}" } source = "apache_install.sh" destination = "/tmp/apache_install.sh" }
the above syntax for getting the host public IP it will not work with multidimensional arrays and it will require unnecessarily complex element()/lookup() functions usage.
Output variables in the format of unnecessarily multidimensional arrays which are hard to query by other tf code using this module:
output "public_ip" { description = "Public IPs of created instances. " value = ["${module.instance.public_ip}"] }
public_ip = [ [ "132.145.XX.YY", "132.145.XX.YY", ], ]
provisioner "file" { connection { user = "opc" agent = false private_key = "${chomp(file(var.ssh_private_key_path))}" timeout = "10m" host = "${module.instance.public_ip[count.index]}" } source = "apache_install.sh" destination = "/tmp/apache_install.sh" }
the above syntax for getting the host public IP it will not work with multidimensional arrays and it will require unnecessarily complex element()/lookup() functions usage.