opnsense_firewall_category (Resource)

To ease maintenance of larger rulesets, OPNsense includes categories for the firewall. Each rule can contain one or more categories.

Example Usage

resource "opnsense_firewall_category" "example_one" {
  name  = "example"
  color = "ffaa00"
}

resource "opnsense_firewall_alias" "example_one" {
  name = "example"

  type = "geoip"
  content = [
    "FR",
    "CA",
  ]

  categories = [
    opnsense_firewall_category.example_one.id
  ]

  stats       = true
  description = "Example"
}

Schema

Required

  • name (String) Enter a name for this category.

Optional

  • auto (Boolean) If set, this category will be removed when unused. This is included for completeness, but will result in constant recreations if not attached to any rules, and thus it is advised to leave it as default. Defaults to false.
  • color (String) Pick a color to use. Must be a hex color in format rrggbb (e.g. ff0000). Defaults to "".

Read-Only

  • id (String) UUID of the resource.

Import

In Terraform v1.5.0 and later, use an import block to import opnsense_firewall_category using the id. For example:

import {
  to = opnsense_firewall_category.example
  id = "<opnsense-resource-id>"
}

Using terraform import, import opnsense_firewall_category using the id. For example:

% terraform import opnsense_firewall_category.example <opnsense-resource-id>