workspaces
Creates, updates, deletes or gets a workspace resource or lists workspaces in a region
Overview
| Name | workspaces |
| Type | Resource |
| Description | Resource Type definition for AWS::APS::Workspace |
| Id | awscc.aps.workspaces |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
workspace_id | string | Required to identify a specific APS Workspace. |
alias | string | AMP Workspace alias. |
arn | string | Workspace arn. |
alert_manager_definition | string | The AMP Workspace alert manager definition data |
prometheus_endpoint | string | AMP Workspace prometheus endpoint |
logging_configuration | object | Logging configuration |
workspace_configuration | object | Workspace configuration |
query_logging_configuration | object | Query logging configuration |
kms_key_arn | string | KMS Key ARN used to encrypt and decrypt AMP workspace data. |
tags | array | An array of key-value pairs to apply to this resource. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
arn | string | Workspace arn. |
region | string | AWS region. |
For more information, see AWS::APS::Workspace.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | workspaces | INSERT | , region |
delete_resource | workspaces | DELETE | Identifier, region |
update_resource | workspaces | UPDATE | Identifier, PatchDocument, region |
list_resources | workspaces_list_only | SELECT | region |
get_resource | workspaces | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual workspace.
SELECT
region,
workspace_id,
alias,
arn,
alert_manager_definition,
prometheus_endpoint,
logging_configuration,
workspace_configuration,
query_logging_configuration,
kms_key_arn,
tags
FROM awscc.aps.workspaces
WHERE
region = 'us-east-1' AND
Identifier = '{{ arn }}';
Lists all workspaces in a region.
SELECT
region,
arn
FROM awscc.aps.workspaces_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new workspace resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.aps.workspaces (
,
region
)
SELECT
'{{ }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.aps.workspaces (
Alias,
AlertManagerDefinition,
LoggingConfiguration,
WorkspaceConfiguration,
QueryLoggingConfiguration,
KmsKeyArn,
Tags,
region
)
SELECT
'{{ alias }}',
'{{ alert_manager_definition }}',
'{{ logging_configuration }}',
'{{ workspace_configuration }}',
'{{ query_logging_configuration }}',
'{{ kms_key_arn }}',
'{{ tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: workspace
props:
- name: alias
value: '{{ alias }}'
- name: alert_manager_definition
value: '{{ alert_manager_definition }}'
- name: logging_configuration
value:
log_group_arn: '{{ log_group_arn }}'
- name: workspace_configuration
value:
retention_period_in_days: '{{ retention_period_in_days }}'
limits_per_label_sets:
- limits:
max_series: '{{ max_series }}'
label_set:
- name: '{{ name }}'
value: '{{ value }}'
- name: query_logging_configuration
value:
destinations:
- cloud_watch_logs:
log_group_arn: '{{ log_group_arn }}'
filters:
qsp_threshold: '{{ qsp_threshold }}'
- name: kms_key_arn
value: '{{ kms_key_arn }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
UPDATE example
Use the following StackQL query and manifest file to update a workspace resource, using stack-deploy.
/*+ update */
UPDATE awscc.aps.workspaces
SET PatchDocument = string('{{ {
"Alias": alias,
"AlertManagerDefinition": alert_manager_definition,
"LoggingConfiguration": logging_configuration,
"WorkspaceConfiguration": workspace_configuration,
"QueryLoggingConfiguration": query_logging_configuration,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}';
DELETE example
/*+ delete */
DELETE FROM awscc.aps.workspaces
WHERE
Identifier = '{{ arn }}' AND
region = 'us-east-1';
Permissions
To operate on the workspaces resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
aps:CreateWorkspace,
aps:DescribeWorkspace,
aps:TagResource,
aps:CreateAlertManagerDefinition,
aps:DescribeAlertManagerDefinition,
aps:CreateLoggingConfiguration,
aps:CreateQueryLoggingConfiguration,
aps:DescribeWorkspaceConfiguration,
aps:UpdateWorkspaceConfiguration,
logs:CreateLogDelivery,
logs:GetLogDelivery,
logs:ListLogDeliveries,
logs:PutResourcePolicy,
kms:CreateGrant,
kms:Decrypt,
kms:GenerateDataKey
aps:DescribeWorkspace,
aps:ListTagsForResource,
aps:DescribeAlertManagerDefinition,
aps:DescribeLoggingConfiguration,
aps:DescribeQueryLoggingConfiguration,
aps:DescribeWorkspaceConfiguration
aps:UpdateWorkspaceAlias,
aps:DescribeWorkspace,
aps:TagResource,
aps:UntagResource,
aps:ListTagsForResource,
aps:CreateAlertManagerDefinition,
aps:PutAlertManagerDefinition,
aps:DeleteAlertManagerDefinition,
aps:CreateLoggingConfiguration,
aps:DescribeLoggingConfiguration,
aps:UpdateLoggingConfiguration,
aps:DeleteLoggingConfiguration,
aps:DescribeWorkspaceConfiguration,
aps:UpdateWorkspaceConfiguration,
aps:CreateQueryLoggingConfiguration,
aps:UpdateQueryLoggingConfiguration,
aps:DeleteQueryLoggingConfiguration,
aps:DescribeQueryLoggingConfiguration,
logs:CreateLogDelivery,
logs:GetLogDelivery,
logs:UpdateLogDelivery,
logs:ListLogDeliveries,
logs:DeleteLogDelivery,
logs:PutResourcePolicy
aps:DeleteWorkspace,
aps:DescribeWorkspace,
aps:DeleteAlertManagerDefinition,
aps:DeleteLoggingConfiguration,
aps:DeleteQueryLoggingConfiguration,
logs:DeleteLogDelivery
aps:ListWorkspaces,
aps:ListTagsForResource