Output public IPs of terraformed servers
This commit is contained in:
parent
84f2e2a4af
commit
f9eb145876
@ -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])
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
7
terraform/outputs.tf
Normal file
7
terraform/outputs.tf
Normal file
@ -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
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user