Skip to content

Commit 01bdd4c

Browse files
committed
docs: make sure examples are up to date
1 parent 425d02d commit 01bdd4c

File tree

5 files changed

+46
-10
lines changed

5 files changed

+46
-10
lines changed

docs/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ terraform {
4848
required_providers {
4949
dash0 = {
5050
source = "dash0hq/dash0"
51-
version = "~> 1.4.0"
51+
version = "~> 1.6.0"
5252
}
5353
}
5454
}
@@ -66,7 +66,7 @@ terraform {
6666
required_providers {
6767
dash0 = {
6868
source = "dash0hq/dash0"
69-
version = "~> 1.4.0"
69+
version = "~> 1.6.0"
7070
}
7171
}
7272
}
@@ -134,4 +134,4 @@ spec:
134134
labels: {}
135135
EOF
136136
}
137-
```
137+
```

examples/provider/provider.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ terraform {
22
required_providers {
33
dash0 = {
44
source = "dash0hq/dash0"
5-
version = "~> 1.4.0"
5+
version = "~> 1.6.0"
66
}
77
}
88
}
99

1010
provider "dash0" {
11-
# Configuration can be provided via environment variables:
12-
# DASH0_URL and DASH0_AUTH_TOKEN
11+
url = "https://api.us-west-2.aws.dash0.com"
12+
auth_token = "auth_xxxx"
1313
}

examples/provider/provider_env.tf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
terraform {
2+
required_providers {
3+
dash0 = {
4+
source = "dash0hq/dash0"
5+
version = "~> 1.6.0"
6+
}
7+
}
8+
}
9+
10+
provider "dash0" {
11+
# Configuration will be read from environment variables:
12+
# DASH0_URL and DASH0_AUTH_TOKEN
13+
}

examples/resources/dash0_synthetic_check/synthetic_check.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ spec:
2121
spec:
2222
type: response
2323
value: 5000ms
24-
operator: lt
24+
operator: lte
2525
degradedAssertions:
2626
- kind: timing
2727
spec:
2828
type: response
2929
value: 2000ms
30-
operator: lt
30+
operator: lte
3131
request:
3232
method: get
3333
url: https://www.example.com

templates/index.md.tmpl

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,41 @@ The Dash0 provider provides dashboard, check rule and more resources for [Dash0]
1212
The changelog for this provider can be found [on GitHub](https://github.com/dash0hq/terraform-provider-dash0/releases).
1313

1414
## Authentication
15-
The Dash0 provider authenticates using environment variables. You can get the value for these environment variables
16-
through [Dash0's settings screens](https://app.dash0.com/settings/auth-tokens).
15+
16+
The Dash0 provider supports two authentication methods. You can get the authentication credentials through [Dash0's settings screens](https://app.dash0.com/settings/auth-tokens).
17+
18+
### Option 1: Environment Variables (Recommended)
19+
20+
Environment variables take precedence over provider configuration attributes.
1721

1822
```sh
1923
export DASH0_URL="https://api.us-west-2.aws.dash0.com"
2024
export DASH0_AUTH_TOKEN="auth_xxxx"
2125
```
2226

27+
### Option 2: Provider Configuration
28+
29+
Alternatively, you can configure authentication directly in the provider block:
30+
31+
```terraform
32+
provider "dash0" {
33+
url = "https://api.us-west-2.aws.dash0.com"
34+
auth_token = "auth_xxxx"
35+
}
36+
```
37+
38+
**Note:** Environment variables (`DASH0_URL` and `DASH0_AUTH_TOKEN`) will override provider configuration attributes if both are set.
39+
2340
## Examples
2441

2542
### Creating a Dash0 provider
2643

44+
#### Using Environment Variables
45+
46+
{{ tffile "examples/provider/provider_env.tf" }}
47+
48+
#### Using Provider Configuration
49+
2750
{{ tffile "examples/provider/provider.tf" }}
2851

2952
### Managing a Dashboard

0 commit comments

Comments
 (0)