Skip to main content

workspaces

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

Overview

Nameworkspaces
TypeResource
Idaws.grafana.workspaces

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe unique ID of this workspace. (pattern: <code>g-[0-9a-f]{10}</code>)
namestringThe name of the workspace. (pattern: <code>[a-zA-Z0-9-._~]{1,255}</code>)
account_access_typestringSpecifies whether the workspace can access Amazon Web Services resources in this Amazon Web Services account only, or whether it can also access Amazon Web Services resources in other accounts in the same organization. If this is ORGANIZATION, the workspaceOrganizationalUnits parameter specifies which organizational units the workspace can access. (CURRENT_ACCOUNT, ORGANIZATION)
authenticationobjectA structure that describes whether the workspace uses SAML, IAM Identity Center, or both methods for user authentication.
createdstring (date-time)The date that the workspace was created.
data_sourcesarraySpecifies the Amazon Web Services data sources that have been configured to have IAM roles and permissions created to allow Amazon Managed Grafana to read data from these sources. This list is only used when the workspace was created through the Amazon Web Services console, and the permissionType is SERVICE_MANAGED.
degraded_workspace_reasonstringIf the workspace is in the DEGRADED status, this field describes the reason the workspace is degraded.
descriptionstringThe user-defined description of the workspace.
endpointstringThe URL that users can use to access the Grafana console in the workspace.
free_trial_consumedbooleanSpecifies whether this workspace has already fully used its free trial for Grafana Enterprise. Amazon Managed Grafana workspaces no longer support Grafana Enterprise free trials.
free_trial_expirationstring (date-time)If this workspace is currently in the free trial period for Grafana Enterprise, this value specifies when that free trial ends. Amazon Managed Grafana workspaces no longer support Grafana Enterprise free trials.
grafana_tokenstringThe token that ties this workspace to a Grafana Labs account. For more information, see Link your account with Grafana Labs.
grafana_versionstringThe version of Grafana supported in this workspace.
ip_address_typestringThe type of IP addresses supported for connection to the workspace. Valid values are IPv4 and DualStack. (IPv4, DualStack)
kms_key_idstringThe ID or ARN of the Key Management Service key used for encrypting workspace data. (pattern: <code>[a-zA-Z0-9:/_-]+</code>)
license_expirationstring (date-time)If this workspace has a full Grafana Enterprise license purchased through Amazon Web Services Marketplace, this specifies when the license ends and will need to be renewed. Purchasing the Enterprise plugins option through Amazon Managed Grafana does not have an expiration. It is valid until the license is removed.
license_typestringSpecifies whether this workspace has a full Grafana Enterprise license. Amazon Managed Grafana workspaces no longer support Grafana Enterprise free trials. (ENTERPRISE, ENTERPRISE_FREE_TRIAL)
modifiedstring (date-time)The most recent date that the workspace was modified.
network_access_controlobjectThe configuration settings for network access to your workspace.
notification_destinationsarrayThe Amazon Web Services notification channels that Amazon Managed Grafana can automatically create IAM roles and permissions for, to allow Amazon Managed Grafana to use these channels.
organization_role_namestringThe name of the IAM role that is used to access resources through Organizations.
organizational_unitsarraySpecifies the organizational units that this workspace is allowed to use data sources from, if this workspace is in an account that is part of an organization.
permission_typestringIf this is SERVICE_MANAGED, and the workplace was created through the Amazon Managed Grafana console, then Amazon Managed Grafana automatically creates the IAM roles and provisions the permissions that the workspace needs to use Amazon Web Services data sources and notification channels. If this is CUSTOMER_MANAGED, you must manage those roles and permissions yourself. If you are working with a workspace in a member account of an organization and that account is not a delegated administrator account, and you want the workspace to access data sources in other Amazon Web Services accounts in the organization, this parameter must be set to CUSTOMER_MANAGED. For more information about converting between customer and service managed, see Managing permissions for data sources and notification channels. For more information about the roles and permissions that must be managed for customer managed workspaces, see Amazon Managed Grafana permissions and policies for Amazon Web Services data sources and notification channels (CUSTOMER_MANAGED, SERVICE_MANAGED)
stack_set_namestringThe name of the CloudFormation stack set that is used to generate IAM roles to be used for this workspace.
statusstringThe current status of the workspace. (ACTIVE, CREATING, DELETING, FAILED, UPDATING, UPGRADING, DELETION_FAILED, CREATION_FAILED, UPDATE_FAILED, UPGRADE_FAILED, LICENSE_REMOVAL_FAILED, VERSION_UPDATING, VERSION_UPDATE_FAILED, DEGRADED)
tagsobjectThe list of tags associated with the workspace.
vpc_configurationobjectThe configuration for connecting to data sources in a private VPC (Amazon Virtual Private Cloud).
workspace_role_arnstringThe IAM role that grants permissions to the Amazon Web Services resources that the workspace will view data from. This role must already exist.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_workspaceselectworkspace_id, regionDisplays information about one Amazon Managed Grafana workspace.
list_workspacesselectregionmaxResults, nextTokenReturns a list of Amazon Managed Grafana workspaces in the account, with some information about each workspace. For more complete information about one workspace, use DescribeWorkspace.
create_workspace_api_keyinsertworkspace_id, region, keyName, keyRole, secondsToLiveCreates 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.
create_workspaceinsertregion, accountAccessType, permissionType, authenticationProvidersCreates a workspace. In a workspace, you can create Grafana dashboards and visualizations to analyze your metrics, logs, and traces. You don't have to build, package, or deploy any hardware to run the Grafana server. Don't use CreateWorkspace to modify an existing workspace. Instead, use UpdateWorkspace.
associate_licenseupdateworkspace_id, license_type, regionGrafana-TokenAssigns a Grafana Enterprise license to a workspace. To upgrade, you must use ENTERPRISE for the licenseType, and pass in a valid Grafana Labs token for the grafanaToken. Upgrading to Grafana Enterprise incurs additional fees. For more information, see Upgrade a workspace to Grafana Enterprise.
update_workspaceupdateworkspace_id, regionModifies an existing Amazon Managed Grafana workspace. If you use this operation and omit any optional parameters, the existing values of those parameters are not changed. To modify the user authentication methods that the workspace uses, such as SAML or IAM Identity Center, use UpdateWorkspaceAuthentication. To modify which users in the workspace have the Admin and Editor Grafana roles, use UpdatePermissions.
delete_workspace_api_keydeletekey_name, workspace_id, regionDeletes a Grafana API key for the workspace. 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.
delete_workspacedeleteworkspace_id, regionDeletes an Amazon Managed Grafana workspace.
disassociate_licenseexecworkspace_id, license_type, regionRemoves the Grafana Enterprise license from a workspace.

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
key_namestringThe name of the API key to delete.
license_typestringThe type of license to remove from the workspace.
regionstringAWS region (default: us-east-1)
workspace_idstringThe ID of the workspace to remove the Grafana Enterprise license from.
Grafana-TokenstringA token from Grafana Labs that ties your Amazon Web Services account with a Grafana Labs account. For more information, see Link your account with Grafana Labs.
maxResultsintegerThe maximum number of workspaces to include in the results.
nextTokenstringThe token for the next set of workspaces to return. (You receive this token from a previous ListWorkspaces operation.)

SELECT examples

Displays information about one Amazon Managed Grafana workspace.

SELECT
id,
name,
account_access_type,
authentication,
created,
data_sources,
degraded_workspace_reason,
description,
endpoint,
free_trial_consumed,
free_trial_expiration,
grafana_token,
grafana_version,
ip_address_type,
kms_key_id,
license_expiration,
license_type,
modified,
network_access_control,
notification_destinations,
organization_role_name,
organizational_units,
permission_type,
stack_set_name,
status,
tags,
vpc_configuration,
workspace_role_arn
FROM aws.grafana.workspaces
WHERE workspace_id = '{{ workspace_id }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

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.

INSERT INTO aws.grafana.workspaces (
keyName,
keyRole,
secondsToLive,
workspace_id,
region
)
SELECT
'{{ keyName }}' /* required */,
'{{ keyRole }}' /* required */,
{{ secondsToLive }} /* required */,
'{{ workspace_id }}',
'{{ region }}'
RETURNING
key,
key_name,
workspace_id
;

UPDATE examples

Assigns a Grafana Enterprise license to a workspace. To upgrade, you must use ENTERPRISE for the licenseType, and pass in a valid Grafana Labs token for the grafanaToken. Upgrading to Grafana Enterprise incurs additional fees. For more information, see Upgrade a workspace to Grafana Enterprise.

UPDATE aws.grafana.workspaces
SET
-- No updatable properties
WHERE
workspace_id = '{{ workspace_id }}' --required
AND license_type = '{{ license_type }}' --required
AND region = '{{ region }}' --required
AND `Grafana-Token` = '{{ Grafana-Token}}'
RETURNING
workspace;

DELETE examples

Deletes a Grafana API key for the workspace. 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.

DELETE FROM aws.grafana.workspaces
WHERE key_name = '{{ key_name }}' --required
AND workspace_id = '{{ workspace_id }}' --required
AND region = '{{ region }}' --required
;

Lifecycle Methods

Removes the Grafana Enterprise license from a workspace.

EXEC aws.grafana.workspaces.disassociate_license
@workspace_id='{{ workspace_id }}' --required,
@license_type='{{ license_type }}' --required,
@region='{{ region }}' --required
;