-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add example.tf; update some types; extend Makefile #40 * Adds e2e tests; fixes to support same Fixes #40
- Loading branch information
Trevor Rosen
committed
Jan 15, 2020
1 parent
789ec78
commit a066d20
Showing
7 changed files
with
151 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
*.dll | ||
*.exe | ||
.DS_Store | ||
example.tf | ||
terraform.tfplan | ||
terraform.tfstate | ||
bin/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
// Used to identify all things made in integration test runs | ||
variable "tf-name-fragment" { | ||
type = "string" | ||
default = "tf_provider_test" | ||
} | ||
|
||
variable "test-metric-name" { | ||
type = "string" | ||
default = "tf_provider_test.cpu.percent.used" // can't interpolate into variables | ||
} | ||
|
||
provider "appoptics" { | ||
// | ||
// Implicitly consumes APPOPTICS_TOKEN from the environment | ||
// | ||
} | ||
|
||
// | ||
// Space | ||
// | ||
resource "appoptics_space" "test_space" { | ||
name = "${var.tf-name-fragment} Space" | ||
} | ||
|
||
|
||
// | ||
// Notification Service | ||
// | ||
resource "appoptics_service" "test_service"{ | ||
title = "${var.tf-name-fragment} Email Notification Service" | ||
type = "mail" | ||
settings = <<EOF | ||
{ | ||
"addresses": "foobar@example.com" | ||
} | ||
EOF | ||
} | ||
|
||
// | ||
// Metric | ||
// | ||
resource "appoptics_metric" "test_metric"{ | ||
name = "${var.test-metric-name}" | ||
display_name = "Terraform Test CPU Utilization" | ||
period = 60 | ||
type = "gauge" | ||
attributes = { | ||
color = "#A3BE8C" | ||
summarize_function = "average" | ||
display_max = 100.0 | ||
display_units_long = "CPU Utilization Percent" | ||
display_units_short = "cpu %" | ||
} | ||
} | ||
|
||
// | ||
// TODO: Chart | ||
// | ||
|
||
// | ||
// Alert | ||
// | ||
resource "appoptics_alert" "test_alert" { | ||
name = "${var.tf-name-fragment}.Alert" | ||
description = "Managed by Terraform" | ||
rearm_seconds = 10800 | ||
|
||
depends_on = ["appoptics_metric.test_metric"] | ||
|
||
condition { | ||
type = "above" | ||
threshold = 0 | ||
metric_name = "${var.test-metric-name}" | ||
duration = 60 | ||
summary_function = "sum" | ||
|
||
tag { | ||
name = "logical_thing" | ||
grouped = true | ||
values = ["staging"] | ||
} | ||
|
||
tag { | ||
name = "event_status" | ||
grouped = true | ||
values = ["count of scary things"] | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters