aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Triguba <hello@eugenetriguba.com>2026-09-23 16:20:57 -0700
committerEugene Triguba <hello@eugenetriguba.com>2026-09-23 16:20:57 -0700
commit46c0f8a62b56bb96f8bece5bf05cb3b8a0920d4f (patch)
treea6a89c01e4f9f2c77e5c9d8e34636016788ba184
parentInitial Commit (diff)
downloadsite-infra-46c0f8a62b56bb96f8bece5bf05cb3b8a0920d4f.zip
Add ipv4 and ipv6 IP to resource creation output
-rw-r--r--main.tf2
-rw-r--r--outputs.tf9
2 files changed, 10 insertions, 1 deletions
diff --git a/main.tf b/main.tf
index 4254f2f..058b5be 100644
--- a/main.tf
+++ b/main.tf
@@ -26,7 +26,7 @@ resource "hcloud_ssh_key" "default" {
public_key = file("~/.ssh/id_rsa.pub")
}
-resource "hcloud_server" "vm" {
+resource "hcloud_server" "web01" {
name = "web01"
image = data.hcloud_image.openbsd.id
server_type = "cx23"
diff --git a/outputs.tf b/outputs.tf
new file mode 100644
index 0000000..52ca13a
--- /dev/null
+++ b/outputs.tf
@@ -0,0 +1,9 @@
+output "server_ipv4" {
+ description = "Public IPv4 address"
+ value = hcloud_server.web01.ipv4_address
+}
+
+output "server_ipv6" {
+ description = "Public IPv6 address"
+ value = hcloud_server.web01.ipv6_address
+}