Firewall
platform_firewall is a security group. Nested rule blocks are the inbound
and outbound rules. An update replaces the whole rule set.
resource "platform_firewall" "web" { name = "web" description = "HTTPS and SSH"
rule { direction = "in" protocol = "tcp" port_range = "22" remote = "0.0.0.0/0" }
rule { direction = "in" protocol = "tcp" port_range = "443" remote = "0.0.0.0/0" }}The server normalizes an omitted action to accept, so leaving action out
of the configuration is not drift.
Arguments
Section titled “Arguments”| Name | Required | Notes |
|---|---|---|
name | yes | Display name |
description | no | Computed if omitted |
rule | no | Nested block, repeatable |
rule block
Section titled “rule block”| Name | Required | Notes |
|---|---|---|
direction | yes | For example in |
protocol | yes | For example tcp |
port_range | no | For example 22 or 80-443 |
remote | no | CIDR, for example 0.0.0.0/0 |
description | no | Per-rule note |
action | no | Computed if omitted (server default accept) |
Attributes
Section titled “Attributes”| Name | Notes |
|---|---|
id | Platform id |
This resource creates, updates rules, and deletes the firewall. Attach and detach to an instance are API actions, not attributes on this resource.
Import
Section titled “Import”terraform import platform_firewall.web fw_…Read rebuilds the rule blocks from the API.