-
Notifications
You must be signed in to change notification settings - Fork 227
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Config Generation: Add test for SM Check generation (#1741)
- Add new `TestAccGenerate_CloudInstance` test function - Add test helper to template the expected files dir (for incrementing IDs or random names in a persistent test env) - Add helper function hook (`stateCheck`) to access the Terraform state. This is used to extract the check ID which is computed after applying. This ID is part of the expected files output
- Loading branch information
1 parent
6ce2740
commit f12a63c
Showing
4 changed files
with
200 additions
and
36 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
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,4 @@ | ||
import { | ||
to = grafana_synthetic_monitoring_check._{{ .ID }} | ||
id = "{{ .ID }}" | ||
} |
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,15 @@ | ||
terraform { | ||
required_providers { | ||
grafana = { | ||
source = "grafana/grafana" | ||
version = "999.999.999" | ||
} | ||
} | ||
} | ||
|
||
provider "grafana" { | ||
url = "https://tfprovidertests.grafana.net/" | ||
auth = "REDACTED" | ||
sm_url = "https://synthetic-monitoring-api-us-east-0.grafana.net" | ||
sm_access_token = "REDACTED" | ||
} |
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,26 @@ | ||
# __generated__ by Terraform | ||
# Please review these resources and move them into your main configuration files. | ||
|
||
# __generated__ by Terraform from "{{ .ID }}" | ||
resource "grafana_synthetic_monitoring_check" "_{{ .ID }}" { | ||
alert_sensitivity = "none" | ||
basic_metrics_only = true | ||
enabled = false | ||
frequency = 60000 | ||
job = "{{ .Job }}" | ||
labels = { | ||
foo = "bar" | ||
} | ||
probes = [7] | ||
target = "https://grafana.com" | ||
timeout = 3000 | ||
settings { | ||
http { | ||
fail_if_not_ssl = false | ||
fail_if_ssl = false | ||
ip_version = "V4" | ||
method = "GET" | ||
no_follow_redirects = false | ||
} | ||
} | ||
} |