opnsense_unbound_host_alias (Resource)

Host aliases can be used to create alternative names for a Host

Example Usage

// 'A' record
resource "opnsense_unbound_host_override" "a_override" {
  enabled = true
  description = "A record override"

  hostname = "*"
  domain = "example.com"
  server = "192.168.1.1"
}

// Enabled alias with description
resource "opnsense_unbound_host_alias" "one_alias" {
  override = opnsense_unbound_host_override.a_override.id

  enabled = true
  hostname = "*"
  domain = "1.example.com"
  description = "Example 1"
}

// Disabled alias without description
resource "opnsense_unbound_host_alias" "two_alias" {
  override = opnsense_unbound_host_override.a_override.id

  enabled = false
  hostname = "*"
  domain = "2.example.com"
}

Schema

Required

  • domain (String) Domain of the host, e.g. example.com.
  • hostname (String) Name of the host, without the domain part. Use * to create a wildcard entry.
  • override (String) The associated host override to apply this alias on.

Optional

  • description (String) Optional description here for your reference (not parsed).
  • enabled (Boolean) Enable this alias for the selected host. Defaults to true.

Read-Only

  • id (String) UUID of the host alias.

Import

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

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

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

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