Skip to content

Create Workspace Api Key

managedgrafana_create_workspace_api_key R Documentation

Creates a Grafana API key for the workspace

Description

Creates a Grafana API key for the workspace. This key can be used to authenticate requests sent to the workspace's HTTP API. See https://docs.aws.amazon.com/grafana/latest/userguide/Using-Grafana-APIs.html for available APIs and example requests.

In workspaces compatible with Grafana version 9 or above, use workspace service accounts instead of API keys. API keys will be removed in a future release.

Usage

managedgrafana_create_workspace_api_key(keyName, keyRole, secondsToLive,
  workspaceId)

Arguments

keyName

[required] Specifies the name of the key. Keynames must be unique to the workspace.

keyRole

[required] Specifies the permission level of the key.

Valid values: ADMIN|EDITOR|VIEWER

secondsToLive

[required] Specifies the time in seconds until the key expires. Keys can be valid for up to 30 days.

workspaceId

[required] The ID of the workspace to create an API key.

Value

A list with the following syntax:

list(
  key = "string",
  keyName = "string",
  workspaceId = "string"
)

Request syntax

svc$create_workspace_api_key(
  keyName = "string",
  keyRole = "string",
  secondsToLive = 123,
  workspaceId = "string"
)