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 = '{{ region }}' AND
Identifier = '{{ arn }}';
Lists all workspaces in a region.
SELECT
region,
arn
FROM awscc.aps.workspaces_list_only
WHERE
region = '{{ region }}';
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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ 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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.aps.workspaces
WHERE
Identifier = '{{ arn }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
Additional Parameters
Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:
| Parameter | Description |
|---|---|
ClientToken | A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request. If you do not specify a client token, one is generated for inclusion in the request. |
RoleArn | The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.If you do not specify a role, a temporary session is created using your AWS user credentials. |
TypeVersionId | For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used. |
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