Terraform provider for aidbox.
- Clone the repository
- Enter the repository directory
- Build the provider using the Go
install
command:
$ go 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 your Terraform provider:
go get github.com/author/dependency
go mod tidy
Then commit the changes to go.mod
and go.sum
.
See examples directory.
If you wish to work on the provider, you'll first need Go installed on your machine (see Requirements above).
To compile the provider, run go install
. This will build the provider and put the provider binary in the $GOPATH/bin
directory.
To generate or update documentation, run go generate
.
In order to run the full suite of Acceptance tests, run make testacc
.
Acceptance tests require an aidbox server to run against.
You can start aidbox in docker with the provided docker-compose file.
Trial license can be obtained either
- as per aidbox documentation
- we can also issue our own development licenses from now on, ask around for these, or try accessing the user portal
$ (cd scripts && AIDBOX_LICENSE=<your-aidbox-license> docker-compose up -d)
$ make testacc
Erase the test cache in case you don't have code changes but still want to run the tests from scratch
(e.g. you only have environmental changes, like updating the docker image):
go clean -testcache
Once the provider is in a suitable state, further to the above testing you can try it out by pointing terraform to look for your build of the provider and use that instead of a released version. Put this in a CLI configuration file (e.g. into a file called .terraformrc in your home dir)
# https://developer.hashicorp.com/terraform/cli/config/config-file#development-overrides-for-provider-developers
# override all provider installations
provider_installation {
# override this specific provider
dev_overrides {
"patientsknowbest/aidbox" = "/home/plugin-developer/go/bin"
}
# must also tell terraform how to look for other providers
direct {}
}