Skip to content

Commit 6e340a1

Browse files
Generate docs
1 parent 7b2c14c commit 6e340a1

File tree

5 files changed

+70
-5
lines changed

5 files changed

+70
-5
lines changed

docs/data-sources/user.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "grafana_user Data Source - terraform-provider-grafana"
4+
subcategory: ""
5+
description: |-
6+
Official documentation https://grafana.com/docs/grafana/latest/manage-users/server-admin/server-admin-manage-users/HTTP API https://grafana.com/docs/grafana/latest/http_api/user/
7+
This resource uses Grafana's admin APIs for creating and updating users which
8+
does not currently work with API Tokens. You must use basic auth.
9+
---
10+
11+
# grafana_user (Data Source)
12+
13+
* [Official documentation](https://grafana.com/docs/grafana/latest/manage-users/server-admin/server-admin-manage-users/)
14+
* [HTTP API](https://grafana.com/docs/grafana/latest/http_api/user/)
15+
16+
This resource uses Grafana's admin APIs for creating and updating users which
17+
does not currently work with API Tokens. You must use basic auth.
18+
19+
## Example Usage
20+
21+
```terraform
22+
resource "grafana_user" "test" {
23+
24+
name = "Testing Datasource"
25+
login = "test-datasource"
26+
password = "my-password"
27+
is_admin = true
28+
}
29+
30+
data "grafana_user" "from_id" {
31+
user_id = grafana_user.test.user_id
32+
}
33+
34+
data "grafana_user" "from_email" {
35+
email = grafana_user.test.email
36+
}
37+
38+
data "grafana_user" "from_login" {
39+
login = grafana_user.test.login
40+
}
41+
```
42+
43+
<!-- schema generated by tfplugindocs -->
44+
## Schema
45+
46+
### Optional
47+
48+
- **email** (String) The email address of the Grafana user. Defaults to ``.
49+
- **id** (String) The ID of this resource.
50+
- **login** (String) The username for the Grafana user. Defaults to ``.
51+
- **user_id** (Number) The numerical ID of the Grafana user. Defaults to `-1`.
52+
53+
### Read-Only
54+
55+
- **is_admin** (Boolean) Whether the user is an admin.
56+
- **name** (String) The display name for the Grafana user.
57+
58+

docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ provider "grafana" {
3232
- **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.
3333
- **insecure_skip_verify** (Boolean) Skip TLS certificate verification. May alternatively be set via the `GRAFANA_INSECURE_SKIP_VERIFY` environment variable.
3434
- **org_id** (Number) The organization id to operate on within grafana. May alternatively be set via the `GRAFANA_ORG_ID` environment variable.
35+
- **retries** (Number) The amount of retries to use for Grafana API calls. May alternatively be set via the `GRAFANA_RETRIES` environment variable.
3536
- **sm_access_token** (String, Sensitive) A Synthetic Monitoring access token. May alternatively be set via the `GRAFANA_SM_ACCESS_TOKEN` environment variable.
3637
- **sm_url** (String) Synthetic monitoring backend address. May alternatively be set via the `GRAFANA_SM_URL` environment variable.
3738
- **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.

docs/resources/user.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ resource "grafana_user" "staff" {
4343
- **login** (String) The username for the Grafana user.
4444
- **name** (String) The display name for the Grafana user.
4545

46+
### Read-Only
47+
48+
- **user_id** (Number) The numerical ID of the Grafana user.
49+
4650
## Import
4751

4852
Import is supported using the following syntax:

grafana/data_source_user.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ does not currently work with API Tokens. You must use basic auth.
2121
ReadContext: dataSourceUserRead,
2222
Schema: map[string]*schema.Schema{
2323
"user_id": {
24-
Type: schema.TypeInt,
25-
Optional: true,
26-
Default: -1,
24+
Type: schema.TypeInt,
25+
Optional: true,
26+
Default: -1,
27+
Description: "The numerical ID of the Grafana user.",
2728
},
2829
"email": {
2930
Type: schema.TypeString,

grafana/resource_user.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ does not currently work with API Tokens. You must use basic auth.
3030
},
3131
Schema: map[string]*schema.Schema{
3232
"user_id": {
33-
Type: schema.TypeInt,
34-
Computed: true,
33+
Type: schema.TypeInt,
34+
Computed: true,
35+
Description: "The numerical ID of the Grafana user.",
3536
},
3637
"email": {
3738
Type: schema.TypeString,

0 commit comments

Comments
 (0)