The Terraform Abion Provider supports resources that performs DNS record updates and data sources for DNS records via the Abion API. You must have an Abion account to retrieve an API key. Contact Abion for help how to create an account and API key. To access the Abion API you also need to get your IP addresses whitelisted by Abion. The Terraform Abion Provider operates on record level so the actual zone must exist and the API Key/account need to have access to the zone.
- Terraform
- Go (1.22)
- GNU Make
- golangci-lint (optional)
- You are only allowed to make 100 updates of a zone per day.
- The zone must exist (and managed by Abion) and the API Key/account needs access to the zone.
- The supported record types:
A
AAAA
CNAME
MX
TXT
NS
SRV
PTR
Official documentation on how to use this provider can be found on the Terraform Registry.
The provided GNUmakefile
defines commands generally useful during development, like for trigger a Golang build and install the Abion Provider,
running acceptance tests, generating documentation, code formatting and linting.
git clone
this repository and cd
into its directory
The default make
command will execute linting, formatting, generate docs, build and install the Abion provider
make
The make install
target will trigger the Golang build and install the provider in your $GOBIN
folder
make install
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 the Abion provider:
go get github.com/author/dependency
go mod tidy
Then commit the changes to go.mod
and go.sum
.
In order to test the Terraform Abion Provider, run to run the full suite of acceptance tests by executing:
ABION_API_KEY=<api key> ABION_API_HOST=<host> make testacc
Configure the ABION_API_KEY and (optional) ABION_API_HOST environment variables.
NOTE!
It's important to understand that acceptance tests (make testacc
) will actually call the Abion API and update zone records. You need a valid API KEY, access to the existing zone and also, your IP address must be whitelisted by Abion to be able to access the Abion API
The Terraform Abion Provider uses terraform-plugin-docs
to generate documentation and store it in the docs/
directory.
Once a release is cut, the Terraform Registry will download the documentation from docs/
and associate it with the release version. Read more about how this works on the
official page.
Use
make generate
to ensure the documentation is re-generated with latest changes.
make fmt
make lint
If running acceptance tests isn't enough, it's possible to set up a local terraform configuration to use a development builds of the provider. This can be achieved by leveraging the Terraform CLI configuration file development overrides.
First, use make install
to place a fresh development build of the provider in your
${GOBIN}
(defaults to ${GOPATH}/bin
or ${HOME}/go/bin
if ${GOPATH}
is not set). Repeat
this every time you make changes to the provider locally.
Then, setup your environment following these instructions to make your local terraform use your local build.
Example of a .terraformrc
file:
provider_installation {
dev_overrides {
"abion/abion" = "<path_to_/go/bin>"
}
# For all other providers, install them directly from their origin provider
# registries as normal. If you omit this, Terraform will _only_ use
# the dev_overrides block, and so no other providers will be available.
direct {}
}
The release process is automated via GitHub Actions, and it's defined in the Workflow release.yml.
Each release is cut by pushing a semantically versioned tag (e.g. v.0.1.0
) to the main branch.