diff --git a/infra/firewall.tf b/infra/firewall.tf index 365b67f..3cf94f2 100644 --- a/infra/firewall.tf +++ b/infra/firewall.tf @@ -1,5 +1,5 @@ -resource "hcloud_firewall" "HomeLab" { - name= "firewall-1" +resource "hcloud_firewall" "prod" { + name= "prod" rule { direction ="in" protocol = "tcp" @@ -58,13 +58,17 @@ resource "hcloud_firewall" "HomeLab" { "::/0" ] } - # rule { - # direction = "in" - # protocol = "tcp" - # port = "22" - # source_ips = [ - # "0.0.0.0/0", - # "::/0" - # ] - #} +} + +resource "hcloud_firewall" "ssh" { + name= "ssh" + rule { + direction ="in" + protocol = "tcp" + port="22" + source_ips = [ + "0.0.0.0/0", + "::/0" + ] + } } diff --git a/infra/server.tf b/infra/server.tf index fd39b30..edc253b 100644 --- a/infra/server.tf +++ b/infra/server.tf @@ -5,7 +5,7 @@ resource "hcloud_server" "HomeLab" { server_type = var.server_type location = var.location ssh_keys = [hcloud_ssh_key.default.id] - firewall_ids = [hcloud_firewall.HomeLab.id] + firewall_ids = [hcloud_firewall.prod.id] labels = { } @@ -17,7 +17,7 @@ resource "hcloud_server" "HomeLab2" { server_type = var.server_type location = var.location ssh_keys = [hcloud_ssh_key.default.id] - firewall_ids = [hcloud_firewall.HomeLab.id] + firewall_ids = [hcloud_firewall.prod.id] labels = { }