Skip to content

patientsknowbest/terraform-provider-aidbox

Repository files navigation

Terraform Provider Aidbox

Terraform provider for aidbox.

Requirements

Building The Provider

  1. Clone the repository
  2. Enter the repository directory
  3. Build the provider using the Go install command:
$ go install

Adding Dependencies

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.

Using the provider

See examples directory.

Developing the Provider

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

$ (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

Trying out the provider without releasing

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 {}
}

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages