Skip to content

Commit a3ad018

Browse files
Migrate Legacy Documentation to tfplugindocs (#187)
1 parent b05aa2f commit a3ad018

File tree

246 files changed

+23846
-1204
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

246 files changed

+23846
-1204
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,18 @@ GRAFANA_ORG_ID=1 \
4343
make testacc
4444
```
4545

46+
## Documentation
47+
48+
Documentation is generated with
49+
[tfplugindocs](https://github.com/hashicorp/terraform-plugin-docs). Generated
50+
files are in `docs/` and should not be updated manually. They are derived from:
51+
52+
* Schema `Description` fields in the provider Go code.
53+
* [examples/](./examples)
54+
* [templates/](./templates)
55+
56+
Use `go generate` to update generated docs.
57+
4658
## Releasing
4759

4860
Builds and releases are automated with GitHub Actions and

docs/index.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
layout: ""
3+
page_title: "Provider: Grafana"
4+
description: |-
5+
The Grafana provider provides configuration management resources for Grafana.
6+
---
7+
8+
# Grafana Provider
9+
10+
The Grafana provider provides configuration management resources for
11+
[Grafana](https://grafana.com/).
12+
13+
## Example Usage
14+
15+
```terraform
16+
provider "grafana" {
17+
url = "http://grafana.example.com/"
18+
auth = var.grafana_auth
19+
}
20+
```
21+
22+
<!-- schema generated by tfplugindocs -->
23+
## Schema
24+
25+
### Required
26+
27+
- **auth** (String, Sensitive) API token or basic auth username:password. May alternatively be set via the `GRAFANA_AUTH` environment variable.
28+
- **url** (String) The root URL of a Grafana server. May alternatively be set via the `GRAFANA_URL` environment variable.
29+
30+
### Optional
31+
32+
- **ca_cert** (String) Certificate CA bundle to use to verify the Grafana server's certificate. May alternatively be set via the `GRAFANA_CA_CERT` environment variable.
33+
- **insecure_skip_verify** (Boolean) Skip TLS certificate verification. May alternatively be set via the `GRAFANA_INSECURE_SKIP_VERIFY` environment variable.
34+
- **org_id** (Number) The organization id to operate on within grafana. May alternatively be set via the `GRAFANA_ORG_ID` environment variable.
35+
- **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.
36+
- **tls_key** (String) Client TLS key file to use to authenticate to the Grafana server. May alternatively be set via the `GRAFANA_TLS_CERT` environment variable.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "grafana_alert_notification Resource - terraform-provider-grafana"
4+
subcategory: ""
5+
description: |-
6+
Official documentation https://grafana.com/docs/grafana/latest/alerting/notifications/HTTP API https://grafana.com/docs/grafana/latest/http_api/alerting_notification_channels/
7+
---
8+
9+
# grafana_alert_notification (Resource)
10+
11+
* [Official documentation](https://grafana.com/docs/grafana/latest/alerting/notifications/)
12+
* [HTTP API](https://grafana.com/docs/grafana/latest/http_api/alerting_notification_channels/)
13+
14+
## Example Usage
15+
16+
```terraform
17+
resource "grafana_alert_notification" "email_someteam" {
18+
name = "Email that team"
19+
type = "email"
20+
is_default = false
21+
send_reminder = true
22+
frequency = "24h"
23+
24+
settings = {
25+
addresses = "foo@example.net;bar@example.net"
26+
uploadImage = "false"
27+
}
28+
}
29+
```
30+
31+
<!-- schema generated by tfplugindocs -->
32+
## Schema
33+
34+
### Required
35+
36+
- **name** (String) The name of the alert notification channel.
37+
- **type** (String) The type of the alert notification channel.
38+
39+
### Optional
40+
41+
- **disable_resolve_message** (Boolean) Whether to disable sending resolve messages. Defaults to `false`.
42+
- **frequency** (String) Frequency of alert reminders. Frequency must be set if reminders are enabled. Defaults to ``.
43+
- **id** (String) The ID of this resource.
44+
- **is_default** (Boolean) Is this the default channel for all your alerts. Defaults to `false`.
45+
- **send_reminder** (Boolean) Whether to send reminders for triggered alerts. Defaults to `false`.
46+
- **settings** (Map of String, Sensitive) Additional settings, for full reference see [Grafana HTTP API documentation](https://grafana.com/docs/grafana/latest/http_api/alerting_notification_channels/).
47+
- **uid** (String) Unique identifier. If unset, this will be automatically generated.
48+
49+

docs/resources/dashboard.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "grafana_dashboard Resource - terraform-provider-grafana"
4+
subcategory: ""
5+
description: |-
6+
Official documentation https://grafana.com/docs/grafana/latest/dashboards/HTTP API https://grafana.com/docs/grafana/latest/http_api/dashboard/
7+
---
8+
9+
# grafana_dashboard (Resource)
10+
11+
* [Official documentation](https://grafana.com/docs/grafana/latest/dashboards/)
12+
* [HTTP API](https://grafana.com/docs/grafana/latest/http_api/dashboard/)
13+
14+
## Example Usage
15+
16+
```terraform
17+
resource "grafana_dashboard" "metrics" {
18+
config_json = file("grafana-dashboard.json")
19+
}
20+
```
21+
22+
<!-- schema generated by tfplugindocs -->
23+
## Schema
24+
25+
### Required
26+
27+
- **config_json** (String) The complete dashboard model JSON.
28+
29+
### Optional
30+
31+
- **folder** (Number) The id of the folder to save the dashboard in.
32+
- **id** (String) The ID of this resource.
33+
34+
### Read-Only
35+
36+
- **dashboard_id** (Number) The numeric ID of the dashboard computed by Grafana.
37+
- **slug** (String) URL friendly version of the dashboard title.
38+
39+
## Import
40+
41+
Import is supported using the following syntax:
42+
43+
```shell
44+
terraform import grafana_dashboard.dashboard_name {{dashboard_slug}}
45+
```
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "grafana_dashboard_permission Resource - terraform-provider-grafana"
4+
subcategory: ""
5+
description: |-
6+
Official documentation https://grafana.com/docs/grafana/latest/permissions/dashboard_folder_permissions/HTTP API https://grafana.com/docs/grafana/latest/http_api/dashboard_permissions/
7+
---
8+
9+
# grafana_dashboard_permission (Resource)
10+
11+
* [Official documentation](https://grafana.com/docs/grafana/latest/permissions/dashboard_folder_permissions/)
12+
* [HTTP API](https://grafana.com/docs/grafana/latest/http_api/dashboard_permissions/)
13+
14+
## Example Usage
15+
16+
```terraform
17+
resource "grafana_team" "team" {
18+
name = "Team Name"
19+
}
20+
21+
resource "grafana_user" "user" {
22+
email = "user.name@example.com"
23+
}
24+
25+
resource "grafana_dashboard" "metrics" {
26+
config_json = file("grafana-dashboard.json")
27+
}
28+
29+
resource "grafana_dashboard_permission" "collectionPermission" {
30+
dashboard_uid = grafana_dashboard.metrics.dashboard_id
31+
permissions {
32+
role = "Editor"
33+
permission = "Edit"
34+
}
35+
permissions {
36+
team_id = grafana_team.team.id
37+
permission = "View"
38+
}
39+
permissions {
40+
user_id = grafana_user.user.id
41+
permission = "Admin"
42+
}
43+
}
44+
```
45+
46+
<!-- schema generated by tfplugindocs -->
47+
## Schema
48+
49+
### Required
50+
51+
- **dashboard_id** (Number) ID of the dashboard to apply permissions to.
52+
- **permissions** (Block Set, Min: 1) The permission items to add/update. Items that are omitted from the list will be removed. (see [below for nested schema](#nestedblock--permissions))
53+
54+
### Optional
55+
56+
- **id** (String) The ID of this resource.
57+
58+
<a id="nestedblock--permissions"></a>
59+
### Nested Schema for `permissions`
60+
61+
Required:
62+
63+
- **permission** (String) Permission to associate with item. Must be one of `View`, `Edit`, or `Admin`.
64+
65+
Optional:
66+
67+
- **role** (String) Manage permissions for `Viewer` or `Editor` roles.
68+
- **team_id** (Number) ID of the team to manage permissions for. Defaults to `0`.
69+
- **user_id** (Number) ID of the user to manage permissions for. Defaults to `0`.
70+
71+

docs/resources/data_source.md

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "grafana_data_source Resource - terraform-provider-grafana"
4+
subcategory: ""
5+
description: |-
6+
Official documentation https://grafana.com/docs/grafana/latest/datasources/HTTP API https://grafana.com/docs/grafana/latest/http_api/data_source/
7+
The required arguments for this resource vary depending on the type of data
8+
source selected (via the 'type' argument).
9+
---
10+
11+
# grafana_data_source (Resource)
12+
13+
* [Official documentation](https://grafana.com/docs/grafana/latest/datasources/)
14+
* [HTTP API](https://grafana.com/docs/grafana/latest/http_api/data_source/)
15+
16+
The required arguments for this resource vary depending on the type of data
17+
source selected (via the 'type' argument).
18+
19+
## Example Usage
20+
21+
```terraform
22+
resource "grafana_data_source" "influxdb" {
23+
type = "influxdb"
24+
name = "myapp-metrics"
25+
url = "http://influxdb.example.net:8086/"
26+
username = "myapp"
27+
password = "foobarbaz"
28+
database_name = influxdb_database.metrics.name
29+
}
30+
31+
resource "grafana_data_source" "cloudwatch" {
32+
type = "cloudwatch"
33+
name = "cw-example"
34+
35+
json_data {
36+
default_region = "us-east-1"
37+
auth_type = "keys"
38+
}
39+
40+
secure_json_data {
41+
access_key = "123"
42+
secret_key = "456"
43+
}
44+
}
45+
46+
resource "grafana_data_source" "stackdriver" {
47+
type = "stackdriver"
48+
name = "sd-example"
49+
50+
json_data {
51+
token_uri = "https://oauth2.googleapis.com/token"
52+
authentication_type = "jwt"
53+
default_project = "default-project"
54+
client_email = "client-email@default-project.iam.gserviceaccount.com"
55+
}
56+
57+
secure_json_data {
58+
private_key = "-----BEGIN PRIVATE KEY-----\nprivate-key\n-----END PRIVATE KEY-----\n"
59+
}
60+
}
61+
```
62+
63+
<!-- schema generated by tfplugindocs -->
64+
## Schema
65+
66+
### Required
67+
68+
- **name** (String) A unique name for the data source.
69+
- **type** (String) The data source type. Must be one of the supported data source keywords.
70+
71+
### Optional
72+
73+
- **access_mode** (String) The method by which Grafana will access the data source: `proxy` or `direct`. Defaults to `proxy`.
74+
- **basic_auth_enabled** (Boolean) Whether to enable basic auth for the data source. Defaults to `false`.
75+
- **basic_auth_password** (String, Sensitive) Basic auth password. Defaults to ``.
76+
- **basic_auth_username** (String) Basic auth username. Defaults to ``.
77+
- **database_name** (String) (Required by some data source types) The name of the database to use on the selected data source server. Defaults to ``.
78+
- **id** (String) The ID of this resource.
79+
- **is_default** (Boolean) Whether to set the data source as default. This should only be `true` to a single data source. Defaults to `false`.
80+
- **json_data** (Block List) (Required by some data source types) (see [below for nested schema](#nestedblock--json_data))
81+
- **password** (String, Sensitive) (Required by some data source types) The password to use to authenticate to the data source. Defaults to ``.
82+
- **secure_json_data** (Block List) (see [below for nested schema](#nestedblock--secure_json_data))
83+
- **url** (String) The URL for the data source. The type of URL required varies depending on the chosen data source type.
84+
- **username** (String) (Required by some data source types) The username to use to authenticate to the data source. Defaults to ``.
85+
86+
<a id="nestedblock--json_data"></a>
87+
### Nested Schema for `json_data`
88+
89+
Optional:
90+
91+
- **assume_role_arn** (String) (CloudWatch) The ARN of the role to be assumed by Grafana when using the CloudWatch data source.
92+
- **auth_type** (String) (CloudWatch) The authentication type used to access the data source.
93+
- **authentication_type** (String) (Stackdriver) The authentication type: `jwt` or `gce`.
94+
- **client_email** (String) (Stackdriver) Service account email address.
95+
- **conn_max_lifetime** (Number) (MySQL, PostgreSQL, and MSSQL) Maximum amount of time in seconds a connection may be reused (Grafana v5.4+).
96+
- **custom_metrics_namespaces** (String) (CloudWatch) A comma-separated list of custom namespaces to be queried by the CloudWatch data source.
97+
- **default_project** (String) (Stackdriver) The default project for the data source.
98+
- **default_region** (String) (CloudWatch) The default region for the data source.
99+
- **encrypt** (String) (MSSQL) Connection SSL encryption handling: 'disable', 'false' or 'true'.
100+
- **es_version** (Number) (Elasticsearch) Elasticsearch version as a number (2/5/56/60/70).
101+
- **graphite_version** (String) (Graphite) Graphite version.
102+
- **http_method** (String) (Prometheus) HTTP method to use for making requests.
103+
- **interval** (String) (Elasticsearch) Index date time format. nil(No Pattern), 'Hourly', 'Daily', 'Weekly', 'Monthly' or 'Yearly'.
104+
- **log_level_field** (String) (Elasticsearch) Which field should be used to indicate the priority of the log message.
105+
- **log_message_field** (String) (Elasticsearch) Which field should be used as the log message.
106+
- **max_idle_conns** (Number) (MySQL, PostgreSQL and MSSQL) Maximum number of connections in the idle connection pool (Grafana v5.4+).
107+
- **max_open_conns** (Number) (MySQL, PostgreSQL and MSSQL) Maximum number of open connections to the database (Grafana v5.4+).
108+
- **postgres_version** (Number) (PostgreSQL) Postgres version as a number (903/904/905/906/1000) meaning v9.3, v9.4, etc.
109+
- **profile** (String) (CloudWatch) The credentials profile name to use when authentication type is set as 'Credentials file'.
110+
- **query_timeout** (String) (Prometheus) Timeout for queries made to the Prometheus data source in seconds.
111+
- **ssl_mode** (String) (PostgreSQL) SSLmode. 'disable', 'require', 'verify-ca' or 'verify-full'.
112+
- **time_field** (String) (Elasticsearch) Which field that should be used as timestamp.
113+
- **time_interval** (String) (Prometheus, Elasticsearch, InfluxDB, MySQL, PostgreSQL, and MSSQL) Lowest interval/step value that should be used for this data source.
114+
- **timescaledb** (Boolean) (PostgreSQL) Enable usage of TimescaleDB extension.
115+
- **tls_auth** (Boolean) (All) Enable TLS authentication using client cert configured in secure json data.
116+
- **tls_auth_with_ca_cert** (Boolean) (All) Enable TLS authentication using CA cert.
117+
- **tls_skip_verify** (Boolean) (All) Controls whether a client verifies the server’s certificate chain and host name.
118+
- **token_uri** (String) (Stackdriver) The token URI used, provided in the service account key.
119+
- **tsdb_resolution** (String) (OpenTSDB) Resolution.
120+
- **tsdb_version** (String) (OpenTSDB) Version.
121+
122+
123+
<a id="nestedblock--secure_json_data"></a>
124+
### Nested Schema for `secure_json_data`
125+
126+
Optional:
127+
128+
- **access_key** (String, Sensitive) (CloudWatch) The access key to use to access the data source.
129+
- **basic_auth_password** (String, Sensitive) (All) Password to use for basic authentication.
130+
- **password** (String, Sensitive) (All) Password to use for authentication.
131+
- **private_key** (String, Sensitive) (Stackdriver) The service account key `private_key` to use to access the data source.
132+
- **secret_key** (String, Sensitive) (CloudWatch) The secret key to use to access the data source.
133+
- **tls_ca_cert** (String, Sensitive) (All) CA cert for out going requests.
134+
- **tls_client_cert** (String, Sensitive) (All) TLS Client cert for outgoing requests.
135+
- **tls_client_key** (String, Sensitive) (All) TLS Client key for outgoing requests.
136+
137+

0 commit comments

Comments
 (0)