permissions
Creates, updates, deletes, gets or lists a permissions resource.
Overview
| Name | permissions |
| Type | Resource |
| Id | aws.grafana.permissions |
Fields
The following fields are returned by SELECT queries:
- list_permissions
| Name | Datatype | Description |
|---|---|---|
role | string | Specifies whether the user or group has the Admin, Editor, or Viewer role. (ADMIN, EDITOR, VIEWER) |
user | object | A structure with the ID of the user or group with this role. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_permissions | select | workspace_id, region | maxResults, nextToken, userType, userId, groupId | 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. |
update_permissions | update | workspace_id, region, updateInstructionBatch | Updates 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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
workspace_id | string | The ID of the workspace to update. |
groupId | string | (Optional) Limits the results to only the group that matches this ID. |
maxResults | integer | The maximum number of results to include in the response. |
nextToken | string | The token to use when requesting the next set of results. You received this token from a previous ListPermissions operation. |
userId | string | (Optional) Limits the results to only the user that matches this ID. |
userType | string | (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
- list_permissions
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
- update_permissions
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;