forked from kube-hetzner/terraform-hcloud-kube-hetzner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
output.tf
57 lines (48 loc) · 1.69 KB
/
output.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
output "cluster_name" {
value = var.cluster_name
description = "Shared suffix for all resources belonging to this cluster."
}
output "network_id" {
value = hcloud_network.k3s.id
description = "The ID of the HCloud network."
}
output "ssh_key_id" {
value = local.hcloud_ssh_key_id
description = "The ID of the HCloud SSH key."
}
output "control_planes_public_ipv4" {
value = [
for obj in module.control_planes : obj.ipv4_address
]
description = "The public IPv4 addresses of the controlplane servers."
}
output "agents_public_ipv4" {
value = [
for obj in module.agents : obj.ipv4_address
]
description = "The public IPv4 addresses of the agent servers."
}
output "ingress_public_ipv4" {
description = "The public IPv4 address of the Hetzner load balancer"
value = local.has_external_load_balancer ? module.control_planes[keys(module.control_planes)[0]].ipv4_address : data.hcloud_load_balancer.cluster[0].ipv4
}
output "ingress_public_ipv6" {
description = "The public IPv6 address of the Hetzner load balancer"
value = (local.has_external_load_balancer || var.load_balancer_disable_ipv6) ? null : data.hcloud_load_balancer.cluster[0].ipv6
}
# Keeping for backward compatibility
output "kubeconfig_file" {
value = local.kubeconfig_external
description = "Kubeconfig file content with external IP address"
sensitive = true
}
output "kubeconfig" {
value = local.kubeconfig_external
description = "Kubeconfig file content with external IP address"
sensitive = true
}
output "kubeconfig_data" {
description = "Structured kubeconfig data to supply to other providers"
value = local.kubeconfig_data
sensitive = true
}