-
Notifications
You must be signed in to change notification settings - Fork 233
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
692ac09
commit eb413b9
Showing
4 changed files
with
111 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "grafana_data_source_config_lbac_rules Resource - terraform-provider-grafana" | ||
subcategory: "Grafana Enterprise" | ||
description: |- | ||
Manages LBAC rules for a data source. | ||
!> Warning: The resource is experimental and will be subject to change. This resource manages the entire LBAC rules tree, and will overwrite any existing rules. | ||
Official documentation https://grafana.com/docs/grafana/latest/administration/data-source-management/teamlbac/[TODO: HTTP API](no api yet) | ||
This resource requires Grafana >=11.0.0. | ||
--- | ||
|
||
# grafana_data_source_config_lbac_rules (Resource) | ||
|
||
Manages LBAC rules for a data source. | ||
|
||
!> Warning: The resource is experimental and will be subject to change. This resource manages the entire LBAC rules tree, and will overwrite any existing rules. | ||
|
||
* [Official documentation](https://grafana.com/docs/grafana/latest/administration/data-source-management/teamlbac/) | ||
* [TODO: HTTP API](no api yet) | ||
|
||
This resource requires Grafana >=11.0.0. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
resource "grafana_team" "team" { | ||
name = "Team Name" | ||
} | ||
resource "grafana_data_source" "test" { | ||
type = "loki" | ||
name = "loki-from-terraform" | ||
url = "https://mylokiurl.net" | ||
basic_auth_enabled = true | ||
basic_auth_username = "username" | ||
json_data_encoded = jsonencode({ | ||
authType = "default" | ||
## basicAuthPassword = "<>" | ||
}) | ||
} | ||
resource "grafana_data_source_config_lbac_rules" "test_rule" { | ||
datasource_uid = grafana_data_source.test.uid | ||
rules = jsonencode({ | ||
"${grafana_team.team.team_uid}" = [ | ||
"{ cluster = \"dev-us-central-0\", namespace = \"hosted-grafana\" }", | ||
"{ foo = \"qux\" }" | ||
] | ||
}) | ||
depends_on = [ | ||
grafana_team.test, | ||
grafana_data_source.test | ||
] | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `datasource_uid` (String) The UID of the datasource. | ||
- `rules` (String) JSON-encoded LBAC rules for the data source. Map of team IDs to lists of rule strings. | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The ID of this resource. | ||
|
||
## Import | ||
|
||
Import is supported using the following syntax: | ||
|
||
```shell | ||
terraform import grafana_data_source_config_lbac_rules.name "{{ datasource_uid }}" | ||
``` |
1 change: 1 addition & 0 deletions
1
examples/resources/grafana_data_source_config_lbac_rules/import.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
terraform import grafana_data_source_config_lbac_rules.name "{{ datasource_uid }}" |
32 changes: 32 additions & 0 deletions
32
examples/resources/grafana_data_source_config_lbac_rules/resource.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
resource "grafana_team" "team" { | ||
name = "Team Name" | ||
} | ||
|
||
resource "grafana_data_source" "test" { | ||
type = "loki" | ||
name = "loki-from-terraform" | ||
url = "https://mylokiurl.net" | ||
basic_auth_enabled = true | ||
basic_auth_username = "username" | ||
|
||
json_data_encoded = jsonencode({ | ||
authType = "default" | ||
## basicAuthPassword = "<>" | ||
}) | ||
} | ||
|
||
resource "grafana_data_source_config_lbac_rules" "test_rule" { | ||
datasource_uid = grafana_data_source.test.uid | ||
rules = jsonencode({ | ||
"${grafana_team.team.team_uid}" = [ | ||
"{ cluster = \"dev-us-central-0\", namespace = \"hosted-grafana\" }", | ||
"{ foo = \"qux\" }" | ||
] | ||
}) | ||
|
||
depends_on = [ | ||
grafana_team.test, | ||
grafana_data_source.test | ||
] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters