Skip to content

Terraform provider supporting configuration of synthetic agents and tests in Kentik

License

Notifications You must be signed in to change notification settings

kentik/terraform-provider-kentik-synthetics

Repository files navigation

Terraform Provider for Kentik synthetic tests

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 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 test-api-server that serves data read from test-data.json

This allows to:

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

Running make test will:

  1. Build and run test-api-server which emulates Kentik API v6 by returning static preconfigured responses
  2. Run tests (communication with test-api-server)
  3. Shut down test-api-server

Debug

For debugging use Delve debugger

make build
dlv exec ./terraform-provider-kentik-synthetics
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.