Manages the entire set of permissions for a service account. Permissions that aren't specified when applying this resource will be removed.
Note: This resource is available from Grafana 9.2.4 onwards.
resource "grafana_service_account" "test" {
name = "sa-terraform-test"
role = "Editor"
is_disabled = false
}
resource "grafana_team" "test_team" {
name = "tf_test_team"
}
resource "grafana_user" "test_user" {
email = "tf_user@test.com"
login = "tf_user@test.com"
password = "password"
}
resource "grafana_service_account_permission" "test_permissions" {
service_account_id = grafana_service_account.test.id
permissions {
user_id = grafana_user.test_user.id
permission = "Edit"
}
permissions {
team_id = grafana_team.test_team.id
permission = "Admin"
}
}
service_account_id
(String) The id of the service account.org_id
(String) The Organization ID. If not set, the Org ID defined in the provider block will be used.permissions
(Block Set) The permission items to add/update. Items that are omitted from the list will be removed. (see below for nested schema)id
(String) The ID of this resource.permissions
Required:
permission
(String) Permission to associate with item. Must be one of View
, Edit
, or Admin
.Optional:
team_id
(String) ID of the team to manage permissions for. Defaults to 0
.user_id
(String) ID of the user or service account to manage permissions for. Defaults to 0
.Import is supported using the following syntax:
terraform import grafana_service_account_permission.name "{{ serviceAccountID }}"
terraform import grafana_service_account_permission.name "{{ orgID }}:{{ serviceAccountID }}"