Terraform module to provision Firewall
resources in Hetzner Cloud.
# Configure the Hetzner Cloud Provider
provider "hcloud" {
token = var.hcloud_token
}
module "firewall" {
source = "../../"
create_firewall = true
firewall_name = "test-fw"
firewall_labels = {
"Name" : "testing-fw"
}
firewall_rules = [
{
direction = "in"
protocol = "tcp"
port = "80"
source_ips = [
"0.0.0.0/0",
"::/0"
]
},
{
direction = "in"
protocol = "tcp"
source_ips = [
"0.0.0.0/0",
"::/0"
]
port = "8080"
description = "This accepts HTTP from anywhere"
},
{
direction = "out"
protocol = "tcp"
destination_ips = [
"10.22.0.0/24",
]
port = "80"
}
]
firewall_apply_to = {
label_selector = "key=value"
}
}
Name | Version |
---|---|
terraform | >= 1.2.0 |
hcloud | >= 1.42.1 |
Name | Version |
---|---|
hcloud | >= 1.42.1 |
No modules.
Name | Type |
---|---|
hcloud_firewall.firewall | resource |
Name | Description | Type | Default | Required |
---|---|---|---|---|
create_firewall | Whether to create a Firewall or not. | bool |
false |
no |
firewall_apply_to | Configuration of a Rule from this Firewall. | object({ |
{} |
no |
firewall_labels | User-defined labels (key-value pairs) should be created with. | map(string) |
{} |
no |
firewall_name | Name of the Firewall. | string |
"" |
no |
firewall_rules | Configuration of a Rule from this Firewall. | list(object({ |
[] |
no |
Name | Description |
---|---|
firewall_apply_to | Configuration of a Rule from this Firewall. |
firewall_id | ID of the Firewall. |
firewall_labels | User-defined labels (key-value pairs) should be created with. |
firewall_name | Name of the Firewall. |
firewall_rule | Configuration of a Rule from this Firewall. |