Release process for the provider is based on github repo tags. Every tag with format v[0-9].[0-9].[0-9] will trigger automatic build of package and publish it in registry.terraform.io.
To build and release package:
- Make sure that all code that you want to release is in master branch
- Create tag with format v[0-9].[0-9].[0-9] in github. Releases -> Draft a new release -> Put tag version, name and description
- Go to Github Actions
Build and install the plugin so that Terraform can find and use it:
make install
Unit tests run the provider against a localhost_apiserver that serves data read from CloudExportTestData.json.
This allows to:
- avoid the necessity of providing valid API credentials
- avoid creating resources on remote server
- make the test results more reliable
make test
This will:
- build and run localhost_apiserver that is a stub for kentik apiv6 server
- run tests (communication with localhost_apiserver)
- shut down localhost_apiserver
Acceptance tests run the provider against live server
make testacc
You need to provide valid credentials as environment variables so that the provider can communicate with the server:
- KTAPI_AUTH_EMAIL
- KTAPI_AUTH_TOKEN
Note: Acceptance tests create real resources.
make build
dlv exec ./terraform-provider-kentik-cloudexport
r -debug
c
# attach with terraform following the just-printed out instruction in your terminal
In folder with Terraform .tf definition file for cloud export resources/data sources:
terraform init
terraform apply
Note: you need to provide kentikapi credentials and also you can provide custom apiserver url, either in .tf file:
provider "kentik-cloudexport" {
email="[email protected]"
token="token123"
# apiurl= "http://localhost:8080" # custom apiserver
}
or as environment variables:
export KTAPI_AUTH_EMAIL="[email protected]"
export KTAPI_AUTH_TOKEN="token123"
# export KTAPI_URL="http://localhost:8080" # custom apiserver
See: examples
If you wish to work on the provider, you'll first need Go installed on your machine (see Requirements above).
To install the provider, run make install
. This will place the compiled provider binary under ~/.terraform.d/plugins/
.
In order to run the full suite of tests, run make test
.
To generate or update documentation, run go generate
.