Hi,
I cannot get element() to work in mf tf output.
output "kube_hosts" {
description = "Control plane endpoints to SSH to"
value = {
control_plane = {
cluster_name = var.cluster_name
cloud_provider = "vsphere"
private_address = []
public_address = element(vsphere_virtual_machine.control_plane.*.guest_ip_addresses, 1)
ssh_agent_socket = var.ssh_agent_socket
ssh_port = var.ssh_port
ssh_private_key_file = var.ssh_private_key_file
ssh_user = var.ssh_username
}
}
}
Am I doing something stupid?
kube_hosts = {
"control_plane" = {
"cloud_provider" = "vsphere"
"cluster_name" = "testing-2"
"private_address" = []
"public_address" = [
"10.2.2.20",
"10.1.32.211",
"fe80::250:56ff:fead:f818",
"fe80::250:56ff:fead:72c1",
]
"ssh_agent_socket" = "env:SSH_AUTH_SOCK"
"ssh_port" = 22
"ssh_private_key_file" = "testing-2/id_rsa"
"ssh_user" = "ubuntu"
}
}
I am expecting to only see one public_address - the 2nd entry.
Cheers,
Andrew