|
| 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 | + |
0 commit comments