Skip to content

Commit 69d6506

Browse files
Remove deprecated attributes from datasource docs (#720)
Closes #714 and #715 We are telling users to stop using `json_data` and `secure_json_data`. The docs should reflect that
1 parent 9183dd4 commit 69d6506

File tree

2 files changed

+66
-77
lines changed

2 files changed

+66
-77
lines changed

docs/resources/data_source.md

Lines changed: 33 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -36,56 +36,50 @@ resource "grafana_data_source" "arbitrary-data" {
3636
}
3737
3838
resource "grafana_data_source" "influxdb" {
39-
type = "influxdb"
40-
name = "myapp-metrics"
41-
url = "http://influxdb.example.net:8086/"
42-
username = "myapp"
43-
password = "foobarbaz"
44-
database_name = influxdb_database.metrics.name
39+
type = "influxdb"
40+
name = "myapp-metrics"
41+
url = "http://influxdb.example.net:8086/"
42+
basic_auth_enabled = true
43+
basic_auth_username = "username"
44+
database_name = influxdb_database.metrics.name
45+
46+
json_data_encoded = jsonencode({
47+
authType = "default"
48+
basicAuthPassword = "mypassword"
49+
})
4550
}
4651
4752
resource "grafana_data_source" "cloudwatch" {
4853
type = "cloudwatch"
4954
name = "cw-example"
5055
51-
json_data {
52-
default_region = "us-east-1"
53-
auth_type = "keys"
54-
}
56+
json_data_encoded = jsonencode({
57+
defaultRegion = "us-east-1"
58+
authType = "keys"
59+
})
5560
56-
secure_json_data {
57-
access_key = "123"
58-
secret_key = "456"
59-
}
61+
secure_json_data_encoded = jsonencode({
62+
accessKey = "123"
63+
secretKey = "456"
64+
})
6065
}
6166
6267
resource "grafana_data_source" "prometheus" {
63-
type = "prometheus"
64-
name = "amp"
65-
url = "https://aps-workspaces.eu-west-1.amazonaws.com/workspaces/ws-1234567890/"
66-
67-
json_data {
68-
http_method = "POST"
69-
sigv4_auth = true
70-
sigv4_auth_type = "default"
71-
sigv4_region = "eu-west-1"
72-
}
73-
}
68+
type = "prometheus"
69+
name = "mimir"
70+
url = "https://my-instances.com"
71+
basic_auth_enabled = true
72+
basic_auth_username = "username"
7473
75-
resource "grafana_data_source" "stackdriver" {
76-
type = "stackdriver"
77-
name = "sd-example"
78-
79-
json_data {
80-
token_uri = "https://oauth2.googleapis.com/token"
81-
authentication_type = "jwt"
82-
default_project = "default-project"
83-
client_email = "[email protected]"
84-
}
85-
86-
secure_json_data {
87-
private_key = "-----BEGIN PRIVATE KEY-----\nprivate-key\n-----END PRIVATE KEY-----\n"
88-
}
74+
json_data_encoded = jsonencode({
75+
httpMethod = "POST"
76+
prometheusType = "Mimir"
77+
prometheusVersion = "2.4.0"
78+
})
79+
80+
secure_json_data_encoded = jsonencode({
81+
basicAuthPassword = "password"
82+
})
8983
}
9084
```
9185

examples/resources/grafana_data_source/resource.tf

Lines changed: 33 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -15,54 +15,49 @@ resource "grafana_data_source" "arbitrary-data" {
1515
}
1616

1717
resource "grafana_data_source" "influxdb" {
18-
type = "influxdb"
19-
name = "myapp-metrics"
20-
url = "http://influxdb.example.net:8086/"
21-
username = "myapp"
22-
password = "foobarbaz"
23-
database_name = influxdb_database.metrics.name
18+
type = "influxdb"
19+
name = "myapp-metrics"
20+
url = "http://influxdb.example.net:8086/"
21+
basic_auth_enabled = true
22+
basic_auth_username = "username"
23+
database_name = influxdb_database.metrics.name
24+
25+
json_data_encoded = jsonencode({
26+
authType = "default"
27+
basicAuthPassword = "mypassword"
28+
})
2429
}
2530

2631
resource "grafana_data_source" "cloudwatch" {
2732
type = "cloudwatch"
2833
name = "cw-example"
2934

30-
json_data {
31-
default_region = "us-east-1"
32-
auth_type = "keys"
33-
}
35+
json_data_encoded = jsonencode({
36+
defaultRegion = "us-east-1"
37+
authType = "keys"
38+
})
3439

35-
secure_json_data {
36-
access_key = "123"
37-
secret_key = "456"
38-
}
40+
secure_json_data_encoded = jsonencode({
41+
accessKey = "123"
42+
secretKey = "456"
43+
})
3944
}
4045

4146
resource "grafana_data_source" "prometheus" {
42-
type = "prometheus"
43-
name = "amp"
44-
url = "https://aps-workspaces.eu-west-1.amazonaws.com/workspaces/ws-1234567890/"
45-
46-
json_data {
47-
http_method = "POST"
48-
sigv4_auth = true
49-
sigv4_auth_type = "default"
50-
sigv4_region = "eu-west-1"
51-
}
52-
}
53-
54-
resource "grafana_data_source" "stackdriver" {
55-
type = "stackdriver"
56-
name = "sd-example"
47+
type = "prometheus"
48+
name = "mimir"
49+
url = "https://my-instances.com"
50+
basic_auth_enabled = true
51+
basic_auth_username = "username"
5752

58-
json_data {
59-
token_uri = "https://oauth2.googleapis.com/token"
60-
authentication_type = "jwt"
61-
default_project = "default-project"
62-
client_email = "[email protected]"
63-
}
53+
json_data_encoded = jsonencode({
54+
httpMethod = "POST"
55+
prometheusType = "Mimir"
56+
prometheusVersion = "2.4.0"
57+
})
6458

65-
secure_json_data {
66-
private_key = "-----BEGIN PRIVATE KEY-----\nprivate-key\n-----END PRIVATE KEY-----\n"
67-
}
59+
secure_json_data_encoded = jsonencode({
60+
basicAuthPassword = "password"
61+
})
6862
}
63+

0 commit comments

Comments
 (0)