From 73b2f392d76d3d04b46e98e930f419ac86fa4220 Mon Sep 17 00:00:00 2001 From: Maximilian Kratz Date: Thu, 6 Apr 2023 10:59:29 +0200 Subject: [PATCH] Adds specific primary IPs to the staging environment --- staging.tf | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/staging.tf b/staging.tf index 7bd2b30..5321201 100644 --- a/staging.tf +++ b/staging.tf @@ -2,6 +2,22 @@ # Create the staging server # +resource "hcloud_primary_ip" "staging-ipv4" { + name = "staging-ipv4" + type = "ipv4" + assignee_type = "server" + auto_delete = false + datacenter = "nbg1-dc3" +} + +resource "hcloud_primary_ip" "staging-ipv6" { + name = "staging-ipv6" + type = "ipv6" + assignee_type = "server" + auto_delete = false + datacenter = "nbg1-dc3" +} + resource "hcloud_server" "staging" { name = "staging" image = "debian-11" @@ -13,6 +29,10 @@ resource "hcloud_server" "staging" { passwd = var.passwd fqdn = "staging.forgejo.dev" }) + public_net { + ipv4 = hcloud_primary_ip.staging-ipv4.id + ipv6 = hcloud_primary_ip.staging-ipv6.id + } } # Set RDNS entry of staging server IPv4