From f20c4079a6483339cf159e410199a2020d36b360 Mon Sep 17 00:00:00 2001 From: Matias Bordese Date: Fri, 17 Jan 2025 10:43:47 -0300 Subject: [PATCH] Update OnCall auth section to prefer service account token setup --- docs/index.md | 19 ++++++++++--------- examples/provider/provider-oncall-sa.tf | 1 + templates/index.md.tmpl | 8 ++++---- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/docs/index.md b/docs/index.md index 00aafcaf7..5f02a5cd6 100644 --- a/docs/index.md +++ b/docs/index.md @@ -165,11 +165,11 @@ data "grafana_synthetic_monitoring_probes" "main" { ```terraform // Step 1: Configure provider block. -// Go to the Grafana OnCall in your stack and create api token in the settings tab.It will be your oncall_access_token. -// If you are using Grafana OnCall OSS consider set oncall_url. You can get it in OnCall -> settings -> API URL. +// You may need to set oncall_url too, depending on your region or if you are using Grafana OnCall OSS. You can get it in OnCall -> settings -> API URL. provider "grafana" { - alias = "oncall" - oncall_access_token = "my_oncall_token" + alias = "oncall" + url = "http://grafana.example.com/" + auth = var.grafana_auth } data "grafana_oncall_user" "alex" { @@ -201,15 +201,16 @@ resource "grafana_oncall_escalation" "example_notify_step" { } ``` -Alternatively, you can also configure the provider block by setting `url` -to your Grafana URL and `auth` to a service account token: +Alternatively, you can also configure the provider block by setting +an specific `oncall_access_token` instead, that you can create in the web UI: ```terraform // Step 1: Configure provider block. +// Go to the Grafana OnCall in your stack and create api token in the settings tab.It will be your oncall_access_token. +// If you are using Grafana OnCall OSS consider set oncall_url. You can get it in OnCall -> settings -> API URL. provider "grafana" { - alias = "oncall" - url = "http://grafana.example.com/" - auth = var.grafana_auth + alias = "oncall" + oncall_access_token = "my_oncall_token" } data "grafana_oncall_user" "alex" { diff --git a/examples/provider/provider-oncall-sa.tf b/examples/provider/provider-oncall-sa.tf index 4929f0afd..498b9e98b 100644 --- a/examples/provider/provider-oncall-sa.tf +++ b/examples/provider/provider-oncall-sa.tf @@ -1,4 +1,5 @@ // Step 1: Configure provider block. +// You may need to set oncall_url too, depending on your region or if you are using Grafana OnCall OSS. You can get it in OnCall -> settings -> API URL. provider "grafana" { alias = "oncall" url = "http://grafana.example.com/" diff --git a/templates/index.md.tmpl b/templates/index.md.tmpl index c1c884ed0..594b008d5 100644 --- a/templates/index.md.tmpl +++ b/templates/index.md.tmpl @@ -28,12 +28,12 @@ The changelog for this provider can be found here: