From 149f2f0d40f5cd4f219e544b881980bc9bfda549 Mon Sep 17 00:00:00 2001 From: Noah Date: Tue, 23 Dec 2025 22:31:21 +0100 Subject: [PATCH] feat: add firewall resource configuration with inbound and outbound rules --- terraform/modules/firewall/main.tf | 51 ++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/terraform/modules/firewall/main.tf b/terraform/modules/firewall/main.tf index e69de29..c1a3f5c 100644 --- a/terraform/modules/firewall/main.tf +++ b/terraform/modules/firewall/main.tf @@ -0,0 +1,51 @@ +resource "hcloud_firewall" "prod-fw" { + name = "prod-fw" + rule { + direction = "in" + protocol = "tcp" + source_ips = [ + "0.0.0.0/0", + "::/0" + ] + port = "22" + description = "Allow SSH" + } + rule { + direction = "in" + protocol = "tcp" + source_ips = [ + "0.0.0.0/0", + "::/0" + ] + port = "80" + description = "Allow HTTP" + } + rule { + direction = "in" + protocol = "tcp" + source_ips = [ + "0.0.0.0/0", + "::/0" + ] + port = "443" + description = "Allow HTTP/S" + } + rule { + direction = "out" + protocol = "tcp" + destination_ips = [ + "0.0.0.0/0", + "::/0" + ] + description = "Allow all outbound TCP traffic" + } + rule { + direction = "out" + protocol = "udp" + destination_ips = [ + "0.0.0.0/0", + "::/0" + ] + description = "Allow all outbound UDP traffic" + } +} \ No newline at end of file