Skip to content

CreateWorkspaceServiceAccount

Source: src/AWS/Grafana/CreateWorkspaceServiceAccount.ts

Runtime binding for the CreateWorkspaceServiceAccount operation (IAM action grafana:CreateWorkspaceServiceAccount), scoped to one Workspace.

Creates a Grafana service account in the workspace — a non-user identity for machine access to the Grafana HTTP API (dashboards, alerts, data sources). Mint API tokens for it with CreateWorkspaceServiceAccountToken. Requires Grafana 9 or newer. Provide the implementation with Effect.provide(AWS.Grafana.CreateWorkspaceServiceAccountHttp).

const createServiceAccount =
yield* Grafana.CreateWorkspaceServiceAccount(workspace);
const account = yield* createServiceAccount({
name: "dashboard-automation",
grafanaRole: "EDITOR",
});
// account.id → the service account id used for token operations