Skip to content

Commit

Permalink
Update sm_url documentation (#571)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
mem and mdb committed Aug 23, 2022
1 parent 44ed4c6 commit 1dd3efe
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 3 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ resource "grafana_folder" "my_folder" {
provider "grafana" {
alias = "cloud"
cloud_api_key = "<my-api-key>"
sm_url = "<synthetic-monitoring-api-url>"
}
resource "grafana_cloud_stack" "sm_stack" {
Expand Down Expand Up @@ -130,6 +131,7 @@ resource "grafana_synthetic_monitoring_installation" "sm_stack" {
provider "grafana" {
alias = "sm"
sm_access_token = grafana_synthetic_monitoring_installation.sm_stack.sm_access_token
sm_url = "<synthetic-monitoring-api-url>"
}
data "grafana_synthetic_monitoring_probes" "main" {
Expand Down Expand Up @@ -213,7 +215,7 @@ resource "grafana_oncall_escalation" "example_notify_step" {
- `org_id` (Number) The organization id to operate on within grafana. May alternatively be set via the `GRAFANA_ORG_ID` environment variable.
- `retries` (Number) The amount of retries to use for Grafana API calls. May alternatively be set via the `GRAFANA_RETRIES` environment variable.
- `sm_access_token` (String, Sensitive) A Synthetic Monitoring access token. May alternatively be set via the `GRAFANA_SM_ACCESS_TOKEN` environment variable.
- `sm_url` (String) Synthetic monitoring backend address. May alternatively be set via the `GRAFANA_SM_URL` environment variable.
- `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.
- `store_dashboard_sha256` (Boolean) Set to true if you want to save only the sha256sum instead of complete dashboard model JSON in the tfstate.
- `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.
- `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.
Expand Down
5 changes: 2 additions & 3 deletions examples/provider/provider-sm.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
provider "grafana" {
alias = "cloud"
cloud_api_key = "<my-api-key>"
sm_url = "<synthetic-monitoring-api-url>"
}

resource "grafana_cloud_stack" "sm_stack" {
Expand Down Expand Up @@ -34,6 +35,7 @@ resource "grafana_synthetic_monitoring_installation" "sm_stack" {
provider "grafana" {
alias = "sm"
sm_access_token = grafana_synthetic_monitoring_installation.sm_stack.sm_access_token
sm_url = "<synthetic-monitoring-api-url>"
}

data "grafana_synthetic_monitoring_probes" "main" {
Expand All @@ -59,6 +61,3 @@ resource "grafana_synthetic_monitoring_check" "ping" {
ping {}
}
}



2 changes: 1 addition & 1 deletion grafana/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func Provider(version string) func() *schema.Provider {
Type: schema.TypeString,
Optional: true,
DefaultFunc: schema.EnvDefaultFunc("GRAFANA_SM_URL", "https://synthetic-monitoring-api.grafana.net"),
Description: "Synthetic monitoring backend address. May alternatively be set via the `GRAFANA_SM_URL` environment variable.",
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.",
ValidateFunc: validation.IsURLWithHTTPorHTTPS,
},
"store_dashboard_sha256": {
Expand Down

0 comments on commit 1dd3efe

Please sign in to comment.