No description
  • Go 97.3%
  • HTML 1.3%
  • Shell 0.8%
  • Makefile 0.6%
Find a file
Jason Bau c9e202329e
Merge pull request #3 from stack72/rename-package
Rename package from wavefront_plugin to wavefront
2020-08-04 16:47:30 -07:00
scripts change permissions 2020-06-02 14:45:57 -07:00
vendor v2.3.0-rc1 updates 2020-06-18 09:33:28 -07:00
wavefront Rename package from wavefront_plugin to wavefront 2020-08-04 18:33:30 +01:00
website Merge remote-tracking branch 'wavefronthq/master' 2020-06-23 16:12:40 -07:00
.gitignore test that applyting resource with tags concurrently works (#19) 2017-11-16 17:10:05 +00:00
.go-version Terraform provider dev program (#19) 2020-05-18 10:53:56 -07:00
.travis.yml Terraform provider dev program (#19) 2020-05-18 10:53:56 -07:00
build.sh use dashes instead of underscores 2020-04-07 14:22:50 +01:00
CHANGELOG.md Cleanup after v2.3.1 release 2020-07-02 16:34:32 +00:00
CONTRIBUTING.md fixes and enhancements, see readme for more information (#14) 2020-05-03 13:54:21 -07:00
GNUmakefile Terraform provider dev program (#19) 2020-05-18 10:53:56 -07:00
go.mod Merge remote-tracking branch 'wavefronthq/master' 2020-06-23 16:12:40 -07:00
go.sum Merge remote-tracking branch 'wavefronthq/master' 2020-06-23 16:12:40 -07:00
LICENSE Issue #4 we have approval from all parties to relicense under MPL2 2020-02-04 16:30:45 -08:00
main.go Rename package from wavefront_plugin to wavefront 2020-08-04 18:33:30 +01:00
README.md fixes and enhancements, see readme for more information (#14) 2020-05-03 13:54:21 -07:00
version Merge remote-tracking branch 'wavefronthq/master' 2020-06-23 16:12:40 -07:00

Wavefront Terraform Provider

A Terraform Provider to manage resources in Wavefront. Currently supports Alerts, Alert Targets and Dashboards.

Requirements

  • Go version 1.13 or higher
  • Terraform 0.10.0 or higher (Custom providers were released at 0.10.0)
  • govendor for dependency management

Installing the Plugin

We release darwin and linux amd64 packages on the releases page. If you require a different architecture you will need to build the plugin from source, see below for more details:

Once you have the plugin you should remove the _os_arch from the end of the file name and place it in ~/.terraform.d/plugins which is where terraform init will look for plugins.

Valid provider filenames are terraform-provider-NAME_X.X.X or terraform-provider-NAME_vX.X.X

Building and Testing

Build the plugin.

make build

This will build amd64 arch binaries for darwin and linux in the format terraform-provider-wavefront_

Unit Test

make test

Acceptance Tests

Acceptance tests are run against the Wavefront API so you'll need an account to use. Run at your own risk.

You need to supply the WAVEFRONT_TOKEN and WAVEFRONT_ADDRESS environment variables

To run the tests run make acceptance

Running the Plugin

Use a main.tf to create some test config, such as

 provider "wavefront" {
   address = "cluster.wavefront.com"
 }

 resource "wavefront_alert" "test_alert" {
   name = "Terraform Test Alert"
   target = "test@example.com"
   condition = "100-ts(\"cpu.usage_idle\", environment=flamingo-int and cpu=cpu-total and service=game-service) > 80"
   display_expression = "100-ts(\"cpu.usage_idle\", environment=flamingo-int and cpu=cpu-total and service=game-service)"
   minutes = 5
   resolve_after_minutes = 5
   severity = "WARN"
   tags = [
     "terraform",
     "flamingo"
   ]
 }

Export your wavefront token export WAVEFRONT_TOKEN=<token> You could also configure the token in the provider section of main.tf, but best not to.

Run terraform init to load your provider.

Run terraform plan to show the plan.

Run terraform apply to apply the test configuration and then check the results in Wavefront.

Update main.tf to change a value, the run plan and apply again to check that updates work.

Run terraform destroy to test deleting resources.

Contributing

Please review the CONTRIBUTOR.md document for more information on contributing.