OPNsense Provider

~> Please note that this provider is under active development, and makes no guarantee to be stable. For that reason, it is not currently recommended to use this provider in any production environment. If a feature is missing, but is documented in the OPNsense API, please raise an issue on the Github repo to indicate interest.

The OPNsense provider is used to interact with resources (only) supported by the OPNsense API. This provider does not, and will not, support resources not currently supported by the OPNsense API. If required, see if dalet-oss/opnsense will support your needs.

The provider needs to be configured with the proper API credentials before it can be used.

Getting Started

To generate the API key & secret, follow the OPNsense docs. These can then be used to configure the provider.

Example Usage

terraform {
  required_providers {
    opnsense = {
      version = "~> x.0"
      source  = "browningluke/opnsense"
    }
  }
}

provider "opnsense" {
  uri = "https://opnsense.example.com"
  api_key = "..."
  api_secret = "..."
}

Schema

Optional

  • allow_insecure (Boolean) Allow insecure TLS connections. Alternatively, can be configured using the OPNSENSE_ALLOW_INSECURE environment variable. Defaults to false.
  • api_key (String) The API key for a user. Alternatively, can be configured using the OPNSENSE_API_KEY environment variable.
  • api_secret (String) The API secret for a user. Alternatively, can be configured using the OPNSENSE_API_SECRET environment variable.
  • max_backoff (Number) Maximum backoff period in seconds after failed API calls. Alternatively, can be configured using the OPNSENSE_MAX_BACKOFF environment variable.
  • min_backoff (Number) Minimum backoff period in seconds after failed API calls. Alternatively, can be configured using the OPNSENSE_MIN_BACKOFF environment variable.
  • retries (Number) Maximum number of retries to perform when an API request fails. Alternatively, can be configured using the OPNSENSE_RETRIES environment variable.
  • uri (String) The URI to an OPNsense host. Alternatively, can be configured using the OPNSENSE_URI environment variable.