Skip to content

Commit 1dd3efe

Browse files
memmdb
andauthored
Update sm_url documentation (#571)
* Update `sm_url` documentation Clarify that the value _should_ be the same everywhere and specify where to find it. Signed-off-by: Marcelo E. Magallon <[email protected]> * improve `sm_url` provider attribute documentation (#581) Signed-off-by: Mike Ball <[email protected]> Signed-off-by: Mike Ball <[email protected]> Signed-off-by: Marcelo E. Magallon <[email protected]> Signed-off-by: Mike Ball <[email protected]> Co-authored-by: Mike Ball <[email protected]>
1 parent 44ed4c6 commit 1dd3efe

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

docs/index.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ resource "grafana_folder" "my_folder" {
9898
provider "grafana" {
9999
alias = "cloud"
100100
cloud_api_key = "<my-api-key>"
101+
sm_url = "<synthetic-monitoring-api-url>"
101102
}
102103
103104
resource "grafana_cloud_stack" "sm_stack" {
@@ -130,6 +131,7 @@ resource "grafana_synthetic_monitoring_installation" "sm_stack" {
130131
provider "grafana" {
131132
alias = "sm"
132133
sm_access_token = grafana_synthetic_monitoring_installation.sm_stack.sm_access_token
134+
sm_url = "<synthetic-monitoring-api-url>"
133135
}
134136
135137
data "grafana_synthetic_monitoring_probes" "main" {
@@ -213,7 +215,7 @@ resource "grafana_oncall_escalation" "example_notify_step" {
213215
- `org_id` (Number) The organization id to operate on within grafana. May alternatively be set via the `GRAFANA_ORG_ID` environment variable.
214216
- `retries` (Number) The amount of retries to use for Grafana API calls. May alternatively be set via the `GRAFANA_RETRIES` environment variable.
215217
- `sm_access_token` (String, Sensitive) A Synthetic Monitoring access token. May alternatively be set via the `GRAFANA_SM_ACCESS_TOKEN` environment variable.
216-
- `sm_url` (String) Synthetic monitoring backend address. May alternatively be set via the `GRAFANA_SM_URL` environment variable.
218+
- `sm_url` (String) Synthetic monitoring backend address. May alternatively be set via the `GRAFANA_SM_URL` environment variable. The correct value for each service region is cited in the [Synthetic Monitoring documentation](https://grafana.com/docs/grafana-cloud/synthetic-monitoring/private-probes/#probe-api-server-url). Note the `sm_url` value is optional, but it must correspond with the value specified as the `region_slug` in the `grafana_cloud_stack` resource. Also note that when a Terraform configuration contains multiple provider instances managing SM resources associated with the same Grafana stack, specifying an explicit `sm_url` set to the same value for each provider ensures all providers interact with the same SM API.
217219
- `store_dashboard_sha256` (Boolean) Set to true if you want to save only the sha256sum instead of complete dashboard model JSON in the tfstate.
218220
- `tls_cert` (String) Client TLS certificate file to use to authenticate to the Grafana server. May alternatively be set via the `GRAFANA_TLS_CERT` environment variable.
219221
- `tls_key` (String) Client TLS key file to use to authenticate to the Grafana server. May alternatively be set via the `GRAFANA_TLS_KEY` environment variable.

examples/provider/provider-sm.tf

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
provider "grafana" {
33
alias = "cloud"
44
cloud_api_key = "<my-api-key>"
5+
sm_url = "<synthetic-monitoring-api-url>"
56
}
67

78
resource "grafana_cloud_stack" "sm_stack" {
@@ -34,6 +35,7 @@ resource "grafana_synthetic_monitoring_installation" "sm_stack" {
3435
provider "grafana" {
3536
alias = "sm"
3637
sm_access_token = grafana_synthetic_monitoring_installation.sm_stack.sm_access_token
38+
sm_url = "<synthetic-monitoring-api-url>"
3739
}
3840

3941
data "grafana_synthetic_monitoring_probes" "main" {
@@ -59,6 +61,3 @@ resource "grafana_synthetic_monitoring_check" "ping" {
5961
ping {}
6062
}
6163
}
62-
63-
64-

grafana/provider.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ func Provider(version string) func() *schema.Provider {
132132
Type: schema.TypeString,
133133
Optional: true,
134134
DefaultFunc: schema.EnvDefaultFunc("GRAFANA_SM_URL", "https://synthetic-monitoring-api.grafana.net"),
135-
Description: "Synthetic monitoring backend address. May alternatively be set via the `GRAFANA_SM_URL` environment variable.",
135+
Description: "Synthetic monitoring backend address. May alternatively be set via the `GRAFANA_SM_URL` environment variable. The correct value for each service region is cited in the [Synthetic Monitoring documentation](https://grafana.com/docs/grafana-cloud/synthetic-monitoring/private-probes/#probe-api-server-url). Note the `sm_url` value is optional, but it must correspond with the value specified as the `region_slug` in the `grafana_cloud_stack` resource. Also note that when a Terraform configuration contains multiple provider instances managing SM resources associated with the same Grafana stack, specifying an explicit `sm_url` set to the same value for each provider ensures all providers interact with the same SM API.",
136136
ValidateFunc: validation.IsURLWithHTTPorHTTPS,
137137
},
138138
"store_dashboard_sha256": {

0 commit comments

Comments
 (0)