Skip to content
Odinex Cloud
Terraform providerReferenceResources

odinex_firewall_attachment

Applies a firewall to servers and label selectors. The ID is the firewall ID. Do not use apply_to blocks on the same odinex_firewall.

Applies a firewall to servers and label selectors. The ID is the firewall ID. Do not use apply_to blocks on the same odinex_firewall.

Example Usage

resource "odinex_firewall_attachment" "web" {
  firewall_id     = odinex_firewall.web.id
  server_ids      = [odinex_server.web.id]
  label_selectors = ["role=web"]
}

Schema

Required

  • firewall_id (Number) ID of the firewall.

Optional

  • label_selectors (Set of String) Label selectors whose servers get the firewall.
  • server_ids (Set of Number) IDs of servers to apply the firewall to.

Read-Only

  • id (String) Unique ID of the resource.

Import

Import is supported using the following syntax:

The terraform import command can be used, for example:

# The ID is the firewall ID.
terraform import odinex_firewall_attachment.web 5

On this page