Terraform providerReferenceResources
odinex_firewall
Manages a firewall. Rules and targets (apply_to) are updated in place. Use either apply_to blocks or odinex_firewall_attachment, not both.
Manages a firewall. Rules and targets (apply_to) are updated in place. Use either apply_to blocks or odinex_firewall_attachment, not both.
Example Usage
resource "odinex_firewall" "web" {
name = "web"
rule {
direction = "in"
protocol = "tcp"
port = "443"
source_ips = ["0.0.0.0/0", "::/0"]
}
apply_to {
label_selector = "role=web"
}
}Schema
Required
name(String) Name of the firewall.
Optional
apply_to(Block Set) Servers or label selectors the firewall applies to. Targets are only tracked while at least oneapply_toblock is configured (and are not imported); without blocks, targets managed byodinex_firewall_attachmentare left alone.labels(Map of String) User-defined labels (key/value pairs). Up to 64 pairs; keys and values up to 63 characters.rule(Block Set) A firewall rule.
Read-Only
id(String) Unique ID of the resource.
Nested Schema for apply_to
Optional:
label_selector(String) Label selector, e.g.role=web.server(Number) ID of a server.
Nested Schema for rule
Required:
direction(String)inorout.protocol(String)tcp,udp,icmp,esporgre.
Optional:
description(String) Description of the rule.destination_ips(Set of String) Destination CIDRs; required foroutrules.port(String) Port (80) or range (1000-2000); required fortcpandudp.source_ips(Set of String) Source CIDRs; required forinrules.
Import
Import is supported using the following syntax:
The terraform import command can be used, for example:
terraform import odinex_firewall.web 5