Skip to main content

permissions

Creates, updates, deletes, gets or lists a permissions resource.

Overview

Namepermissions
TypeResource
Idaws.grafana.permissions

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
rolestringSpecifies whether the user or group has the Admin, Editor, or Viewer role. (ADMIN, EDITOR, VIEWER)
userobjectA structure with the ID of the user or group with this role.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_permissionsselectworkspace_id, regionmaxResults, nextToken, userType, userId, groupIdLists the users and groups who have the Grafana Admin and Editor roles in this workspace. If you use this operation without specifying userId or groupId, the operation returns the roles of all users and groups. If you specify a userId or a groupId, only the roles for that user or group are returned. If you do this, you can specify only one userId or one groupId.
update_permissionsupdateworkspace_id, region, updateInstructionBatchUpdates which users in a workspace have the Grafana Admin or Editor roles.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)
workspace_idstringThe ID of the workspace to update.
groupIdstring(Optional) Limits the results to only the group that matches this ID.
maxResultsintegerThe maximum number of results to include in the response.
nextTokenstringThe token to use when requesting the next set of results. You received this token from a previous ListPermissions operation.
userIdstring(Optional) Limits the results to only the user that matches this ID.
userTypestring(Optional) If you specify SSO_USER, then only the permissions of IAM Identity Center users are returned. If you specify SSO_GROUP, only the permissions of IAM Identity Center groups are returned.

SELECT examples

Lists the users and groups who have the Grafana Admin and Editor roles in this workspace. If you use this operation without specifying userId or groupId, the operation returns the roles of all users and groups. If you specify a userId or a groupId, only the roles for that user or group are returned. If you do this, you can specify only one userId or one groupId.

SELECT
role,
user
FROM aws.grafana.permissions
WHERE workspace_id = '{{ workspace_id }}' -- required
AND region = '{{ region }}' -- required
AND maxResults = '{{ maxResults }}'
AND nextToken = '{{ nextToken }}'
AND userType = '{{ userType }}'
AND userId = '{{ userId }}'
AND groupId = '{{ groupId }}'
;

UPDATE examples

Updates which users in a workspace have the Grafana Admin or Editor roles.

UPDATE aws.grafana.permissions
SET
updateInstructionBatch = '{{ updateInstructionBatch }}'
WHERE
workspace_id = '{{ workspace_id }}' --required
AND region = '{{ region }}' --required
AND updateInstructionBatch = '{{ updateInstructionBatch }}' --required
RETURNING
errors;