Skip to content

Commit 5560608

Browse files
authored
Update OnCall auth section to prefer service account token setup (#1986)
1 parent 8ced17a commit 5560608

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

docs/index.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,11 @@ data "grafana_synthetic_monitoring_probes" "main" {
165165

166166
```terraform
167167
// Step 1: Configure provider block.
168-
// Go to the Grafana OnCall in your stack and create api token in the settings tab.It will be your oncall_access_token.
169-
// If you are using Grafana OnCall OSS consider set oncall_url. You can get it in OnCall -> settings -> API URL.
168+
// 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.
170169
provider "grafana" {
171-
alias = "oncall"
172-
oncall_access_token = "my_oncall_token"
170+
alias = "oncall"
171+
url = "http://grafana.example.com/"
172+
auth = var.grafana_auth
173173
}
174174
175175
data "grafana_oncall_user" "alex" {
@@ -201,15 +201,16 @@ resource "grafana_oncall_escalation" "example_notify_step" {
201201
}
202202
```
203203

204-
Alternatively, you can also configure the provider block by setting `url`
205-
to your Grafana URL and `auth` to a service account token:
204+
Alternatively, you can also configure the provider block by setting
205+
an specific `oncall_access_token` instead, that you can create in the web UI:
206206

207207
```terraform
208208
// Step 1: Configure provider block.
209+
// Go to the Grafana OnCall in your stack and create api token in the settings tab.It will be your oncall_access_token.
210+
// If you are using Grafana OnCall OSS consider set oncall_url. You can get it in OnCall -> settings -> API URL.
209211
provider "grafana" {
210-
alias = "oncall"
211-
url = "http://grafana.example.com/"
212-
auth = var.grafana_auth
212+
alias = "oncall"
213+
oncall_access_token = "my_oncall_token"
213214
}
214215
215216
data "grafana_oncall_user" "alex" {

examples/provider/provider-oncall-sa.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// Step 1: Configure provider block.
2+
// 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.
23
provider "grafana" {
34
alias = "oncall"
45
url = "http://grafana.example.com/"

templates/index.md.tmpl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ The changelog for this provider can be found here: <https://github.com/grafana/t
2828

2929
### Managing Grafana OnCall
3030

31-
{{ tffile "examples/provider/provider-oncall.tf" }}
31+
{{ tffile "examples/provider/provider-oncall-sa.tf" }}
3232

33-
Alternatively, you can also configure the provider block by setting `url`
34-
to your Grafana URL and `auth` to a service account token:
33+
Alternatively, you can also configure the provider block by setting
34+
an specific `oncall_access_token` instead, that you can create in the web UI:
3535

36-
{{ tffile "examples/provider/provider-oncall-sa.tf" }}
36+
{{ tffile "examples/provider/provider-oncall.tf" }}
3737

3838
{{ .SchemaMarkdown | trimspace }}
3939

0 commit comments

Comments
 (0)