modify firewall configuration

This commit is contained in:
vincent 2022-09-03 09:01:47 +02:00
parent a5c26e1210
commit e88583f82a
2 changed files with 17 additions and 13 deletions

View File

@ -1,5 +1,5 @@
resource "hcloud_firewall" "HomeLab" { resource "hcloud_firewall" "prod" {
name= "firewall-1" name= "prod"
rule { rule {
direction ="in" direction ="in"
protocol = "tcp" protocol = "tcp"
@ -58,13 +58,17 @@ resource "hcloud_firewall" "HomeLab" {
"::/0" "::/0"
] ]
} }
# rule { }
# direction = "in"
# protocol = "tcp" resource "hcloud_firewall" "ssh" {
# port = "22" name= "ssh"
# source_ips = [ rule {
# "0.0.0.0/0", direction ="in"
# "::/0" protocol = "tcp"
# ] port="22"
#} source_ips = [
"0.0.0.0/0",
"::/0"
]
}
} }

View File

@ -5,7 +5,7 @@ resource "hcloud_server" "HomeLab" {
server_type = var.server_type server_type = var.server_type
location = var.location location = var.location
ssh_keys = [hcloud_ssh_key.default.id] ssh_keys = [hcloud_ssh_key.default.id]
firewall_ids = [hcloud_firewall.HomeLab.id] firewall_ids = [hcloud_firewall.prod.id]
labels = { labels = {
} }
@ -17,7 +17,7 @@ resource "hcloud_server" "HomeLab2" {
server_type = var.server_type server_type = var.server_type
location = var.location location = var.location
ssh_keys = [hcloud_ssh_key.default.id] ssh_keys = [hcloud_ssh_key.default.id]
firewall_ids = [hcloud_firewall.HomeLab.id] firewall_ids = [hcloud_firewall.prod.id]
labels = { labels = {
} }