diff --git a/terraform/modules/private_server_group/main.tf b/terraform/modules/private_server_group/main.tf index a6ba846..f0e8142 100644 --- a/terraform/modules/private_server_group/main.tf +++ b/terraform/modules/private_server_group/main.tf @@ -38,6 +38,6 @@ resource "hcloud_network_subnet" "main" { resource "hcloud_ssh_key" "main" { count = length(var.ssh_keys) - name = "ssh-key-${count.index}" + name = "ssh-key${count.index}" public_key = file(var.ssh_keys[count.index]) } diff --git a/terraform/modules/private_server_group/outputs.tf b/terraform/modules/private_server_group/outputs.tf index 7486dfe..19eedec 100644 --- a/terraform/modules/private_server_group/outputs.tf +++ b/terraform/modules/private_server_group/outputs.tf @@ -14,6 +14,10 @@ output "server_network" { value = hcloud_server.private_node[*].network } +output "server_public_ips" { + value = { for s in hcloud_server.private_node : s.name => s.ipv4_address } +} + output "ssh_key_ids" { value = hcloud_ssh_key.main[*].id } diff --git a/terraform/outputs.tf b/terraform/outputs.tf new file mode 100644 index 0000000..7b24b45 --- /dev/null +++ b/terraform/outputs.tf @@ -0,0 +1,7 @@ +output "lb_public_ip" { + value = module.loadbalancer.lb_public_ip +} + +output "server_ips" { + value = module.private_server_group.server_public_ips +}