grafana_service_account_permission (Resource)

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.

Example Usage

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"
  }
}

Schema

Required

Optional

Read-Only

Nested Schema for permissions

Required:

Optional:

Import

Import is supported using the following syntax:

terraform import grafana_service_account_permission.name "{{ serviceAccountID }}"
terraform import grafana_service_account_permission.name "{{ orgID }}:{{ serviceAccountID }}"