Skip to content

kentik/terraform-provider-kentik-cloudexport

Repository files navigation

Terraform Provider for Kentik Cloud Export

Requirements

Usage

Detailed user documentation for the provider can be found here.

Development

Anybody who wants to contribute to development is welcome to provide pull requests. To work on the provider, install tools listed in requirements section.

Optional tools:

Development steps:

  • Build the provider: make build
  • Build and install the provider locally: make install
  • Run tests: make test
  • Run acceptance tests: make acceptance
  • Run golangci-lint: make lint
  • Format the code: make fmt
  • Generate the documentation: make docs
  • Check if generated documentation is up-to-date: make check-docs
  • Check Go module consistency: make check-go-mod

Test

Tests run the provider against a testAPIServer

This allows to:

  • avoid the necessity of providing valid API credentials
  • avoid creating resources on remote server
  • make the test results more reliable

Acceptance Tests

Acceptance tests run the provider against production server. To run it locally, you need to set your login credentials as environment variables as below.

export KTAPI_AUTH_EMAIL=<Kentik API authentication email>
export KTAPI_AUTH_TOKEN=<Kentik API authentication token>

Debug

For debugging use Delve debugger

make build
dlv exec ./terraform-provider-kentik-cloudexport
r -debug
c
# attach with terraform following the just-printed out instruction in your terminal

Release

Release process for the provider is based on Git repository tags that follow semantic versioning. Every tag with format v[0-9].[0-9].[0-9] will trigger automatic build of package and publish it in Terraform registry.

To release the provider:

  1. Make sure that all code that you want to release is in master branch.
  2. Navigate to repository releases page, click Draft a new release button and put tag version (in v[0-9].[0-9].[0-9] format), name and description.
  3. Go to GitHub Actions to observe the release job.