infrastructure/terraform/hetzner_firewall.tf

53 lines
715 B
Terraform
Raw Permalink Normal View History

2024-05-04 13:20:15 +01:00
resource "hcloud_firewall" "base" {
name = "base"
rule {
direction = "in"
protocol = "icmp"
source_ips = [
"0.0.0.0/0",
"::/0"
]
}
}
resource "hcloud_firewall" "tailscale" {
name = "tailscale"
rule {
direction = "in"
protocol = "udp"
port = "41641"
source_ips = [
"0.0.0.0/0",
"::/0"
]
}
}
resource "hcloud_firewall" "web" {
name = "web"
# HTTP
rule {
direction = "in"
protocol = "tcp"
port = "80"
source_ips = [
"0.0.0.0/0",
"::/0"
]
}
# HTTPS
rule {
direction = "in"
protocol = "tcp"
port = "443"
source_ips = [
"0.0.0.0/0",
"::/0"
]
}
}