From 499b3ffd18e5b85f312bf1313b85143a83f39e25 Mon Sep 17 00:00:00 2001 From: Trevor Rosen Date: Thu, 16 Jan 2020 13:56:48 -0600 Subject: [PATCH] Cleanup README; "service"->"notification service" Fixes #19 --- README.md | 78 +++++++++---------------------------------- appoptics/provider.go | 10 +++--- example.tf | 2 +- 3 files changed, 22 insertions(+), 68 deletions(-) diff --git a/README.md b/README.md index 9928115..02844fa 100644 --- a/README.md +++ b/README.md @@ -1,67 +1,21 @@ -Terraform Provider -================== +## terraform-provider-appoptics +This provider lets you save clicking in the AO UI by allowing you to produce AppOptics bits alongside the rest of your cloud infratructure. -- Website: https://www.terraform.io -- [![Gitter chat](https://badges.gitter.im/hashicorp-terraform/Lobby.png)](https://gitter.im/hashicorp-terraform/Lobby) -- Mailing list: [Google Groups](http://groups.google.com/group/terraform-tool) +You're able to programmatically create: - +* Dashboards +* Charts +* Metrics +* Alerts +* Notification Services -Requirements ------------- +### Example usage +See `example.tf` [in this repo](https://github.com/appoptics/terraform-provider-appoptics/blob/master/example.tf) to understand how to start using the plugin. -- [Terraform](https://www.terraform.io/downloads.html) 0.10.x -- [Go](https://golang.org/doc/install) 1.8 (to build the provider plugin) +### Installing +* Grab the latest release from the [Releases page](https://github.com/appoptics/terraform-provider-appoptics/releases). +* Place the binary (`terraform-provider-appoptics`) [where Terraform can find it](https://www.terraform.io/docs/plugins/basics.html#installing-plugins) +* You should now be able to write TF code for AppOptics alongside the rest of your infrastructure code -Building The Provider ---------------------- - -Clone repository to: `$GOPATH/src/github.com/terraform-providers/terraform-provider-appoptics` - -```sh -$ mkdir -p $GOPATH/src/github.com/terraform-providers; cd $GOPATH/src/github.com/terraform-providers -$ git clone git@github.com:terraform-providers/terraform-provider-appoptics -``` - -Enter the provider directory and build the provider - -```sh -$ cd $GOPATH/src/github.com/terraform-providers/terraform-provider-appoptics -$ make build -``` - -Using the provider ----------------------- -## Fill in for each provider - -Developing the Provider ---------------------------- - -If you wish to work on the provider, you'll first need [Go](http://www.golang.org) installed on your machine (version 1.8+ is *required*). You'll also need to correctly setup a [GOPATH](http://golang.org/doc/code.html#GOPATH), as well as adding `$GOPATH/bin` to your `$PATH`. - -To compile the provider, run `make build`. This will build the provider and put the provider binary in the `$GOPATH/bin` directory. - -```sh -$ make bin -... -$ $GOPATH/bin/terraform-provider-appoptics -... -``` - -In order to test the provider, you can simply run `make test`. - -```sh -$ make test -``` - -In order to run the full suite of Acceptance tests, run `make testacc`. - -*Note:* Acceptance tests create real resources, and often cost money to run. - -```sh -$ make testacc -``` - -## Env Vars -* `set -gx TF_ACC 1` -- flag for creating live resources -* `set -gx APPOPTICS_TOKEN` -- API Token (secret!) for AO +### Issues/Bugs +Please report bugs in the Issues area of this repo. diff --git a/appoptics/provider.go b/appoptics/provider.go index 3e8571e..9e6a046 100644 --- a/appoptics/provider.go +++ b/appoptics/provider.go @@ -21,11 +21,11 @@ func Provider() terraform.ResourceProvider { }, ResourcesMap: map[string]*schema.Resource{ - "appoptics_dashboard": resourceAppOpticsSpace(), // name is legacy from Librato - "appoptics_dashboard_chart": resourceAppOpticsSpaceChart(), // name is legacy from Librato - "appoptics_metric": resourceAppOpticsMetric(), - "appoptics_alert": resourceAppOpticsAlert(), - "appoptics_service": resourceAppOpticsService(), + "appoptics_dashboard": resourceAppOpticsSpace(), // name is legacy from Librato + "appoptics_dashboard_chart": resourceAppOpticsSpaceChart(), // name is legacy from Librato + "appoptics_metric": resourceAppOpticsMetric(), + "appoptics_alert": resourceAppOpticsAlert(), + "appoptics_notification_service": resourceAppOpticsService(), // changed from API name to differentiate w/ APM Services }, ConfigureFunc: providerConfigure, diff --git a/example.tf b/example.tf index 5ad9ebd..ea89b58 100644 --- a/example.tf +++ b/example.tf @@ -26,7 +26,7 @@ resource "appoptics_dashboard" "test_dashboard" { // // Notification Service // -resource "appoptics_service" "test_service"{ +resource "appoptics_notification_service" "test_service"{ title = "${var.tf-name-fragment} Email Notification Service" type = "mail" settings = <