Manages the entire set of assignments for a role. Assignments that aren't specified when applying this resource will be removed. Note: This resource is available only with Grafana Enterprise 9.2+.
resource "grafana_role" "test_role" {
name = "Test Role"
uid = "testrole"
version = 1
global = true
permissions {
action = "org.users:add"
scope = "users:*"
}
}
resource "grafana_team" "test_team" {
name = "terraform_test_team"
}
resource "grafana_user" "test_user" {
email = "terraform_user@test.com"
login = "terraform_user@test.com"
password = "password"
}
resource "grafana_service_account" "test_sa" {
name = "terraform_test_sa"
role = "Viewer"
}
resource "grafana_role_assignment" "test" {
role_uid = grafana_role.test_role.uid
users = [grafana_user.test_user.id]
teams = [grafana_team.test_team.id]
service_accounts = [grafana_service_account.test_sa.id]
}
role_uid
(String) Grafana RBAC role UID.org_id
(String) The Organization ID. If not set, the Org ID defined in the provider block will be used.service_accounts
(Set of String) IDs of service accounts that the role should be assigned to.teams
(Set of String) IDs of teams that the role should be assigned to.users
(Set of Number) IDs of users that the role should be assigned to.id
(String) The ID of this resource.Import is supported using the following syntax:
terraform import grafana_role_assignment.name "{{ roleUID }}"
terraform import grafana_role_assignment.name "{{ orgID }}:{{ roleUID }}"