This Terraform provider is designed to interact with ISC Kea's Configuration Backend to manage Kea configuration stored in a remote backend such as MySQL or PostgreSQL.
Note: This provider requires the libdhcp_db_cmds.so. hook library to be installed and configured on the Kea server. See the Kea documentation for more information.
This repository is built on Terraform scaffolding for providers and contains the following:
- A resource and a data source (
internal/provider/
), - Examples (
examples/
) and generated documentation (docs/
), - Miscellaneous meta files.
- Clone the repository
- Enter the repository directory
- Build the provider using the Go
install
command or the Makefilebuild
target.
make build
This provider uses Go modules. Please see the Go documentation for the most up-to-date information about using Go modules.
To add a new dependency github.com/author/dependency
to your Terraform provider:
go get -u github.com/author/dependency
go mod tidy && go mod vendor
Then commit the changes to go.mod
and go.sum
.
provider "kea" {
username = "some-kea-ctrl-user"
password = "some-kea-ctrl-password"
}
kea_remote_subnet4_data_source
data "kea_remote_subnet4_data_source" "example" {
hostname = "kea-primary.example.com"
prefix = "192.168.230.0/24"
}
kea_remote_subnet4_resource
resource "kea_remote_subnet4_resource" "example" {
hostname = "kea-primary.example.com"
subnet = "192.168.225.0/24"
pools = [
{ pool = "192.168.225.50-192.168.225.150" }
]
relay = [
{ ip_address = "192.168.225.1" }
]
option_data = [
{ code = 3, name = "routers", data = "192.168.225.1" },
{ code = 15, name = "domain-name", data = "example.com" },
{ code = 6, name = "domain-name-servers", data = "4.2.2.2, 8.8.8.8", always_send = true },
]
}
If you wish to work on the provider, you'll first need Go installed on your machine (see Requirements above).
See the DEVELOPMENT documentation for more information.