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" {
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"
]
}
}

View File

@ -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 = {
}