work_groups
Creates, updates, deletes or gets a work_group resource or lists work_groups in a region
Overview
| Name | work_groups |
| Type | Resource |
| Description | Resource schema for AWS::Athena::WorkGroup |
| Id | awscc.athena.work_groups |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
name | string | The workGroup name. |
description | string | The workgroup description. |
tags | array | One or more tags, separated by commas, that you want to attach to the workgroup as you create it |
work_group_configuration | object | The workgroup configuration |
work_group_configuration_updates | object | The workgroup configuration update object |
creation_time | string | The date and time the workgroup was created. |
state | string | The state of the workgroup: ENABLED or DISABLED. |
recursive_delete_option | boolean | The option to delete the workgroup and its contents even if the workgroup contains any named queries. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
name | string | The workGroup name. |
region | string | AWS region. |
For more information, see AWS::Athena::WorkGroup.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | work_groups | INSERT | Name, region |
delete_resource | work_groups | DELETE | Identifier, region |
update_resource | work_groups | UPDATE | Identifier, PatchDocument, region |
list_resources | work_groups_list_only | SELECT | region |
get_resource | work_groups | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual work_group.
SELECT
region,
name,
description,
tags,
work_group_configuration,
work_group_configuration_updates,
creation_time,
state,
recursive_delete_option
FROM awscc.athena.work_groups
WHERE
region = 'us-east-1' AND
Identifier = '{{ name }}';
Lists all work_groups in a region.
SELECT
region,
name
FROM awscc.athena.work_groups_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new work_group resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.athena.work_groups (
Name,
region
)
SELECT
'{{ name }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.athena.work_groups (
Name,
Description,
Tags,
WorkGroupConfiguration,
WorkGroupConfigurationUpdates,
State,
RecursiveDeleteOption,
region
)
SELECT
'{{ name }}',
'{{ description }}',
'{{ tags }}',
'{{ work_group_configuration }}',
'{{ work_group_configuration_updates }}',
'{{ state }}',
'{{ recursive_delete_option }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: work_group
props:
- name: name
value: '{{ name }}'
- name: description
value: '{{ description }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
- name: work_group_configuration
value:
bytes_scanned_cutoff_per_query: '{{ bytes_scanned_cutoff_per_query }}'
enforce_work_group_configuration: '{{ enforce_work_group_configuration }}'
publish_cloud_watch_metrics_enabled: '{{ publish_cloud_watch_metrics_enabled }}'
requester_pays_enabled: '{{ requester_pays_enabled }}'
result_configuration:
encryption_configuration:
encryption_option: '{{ encryption_option }}'
kms_key: '{{ kms_key }}'
output_location: '{{ output_location }}'
expected_bucket_owner: '{{ expected_bucket_owner }}'
acl_configuration:
s3_acl_option: '{{ s3_acl_option }}'
engine_version:
selected_engine_version: '{{ selected_engine_version }}'
effective_engine_version: '{{ effective_engine_version }}'
additional_configuration: '{{ additional_configuration }}'
execution_role: '{{ execution_role }}'
customer_content_encryption_configuration:
kms_key: null
managed_query_results_configuration:
encryption_configuration:
kms_key: null
enabled: '{{ enabled }}'
- name: work_group_configuration_updates
value:
bytes_scanned_cutoff_per_query: null
enforce_work_group_configuration: null
publish_cloud_watch_metrics_enabled: null
requester_pays_enabled: null
result_configuration_updates:
encryption_configuration: null
output_location: null
expected_bucket_owner: null
acl_configuration: null
remove_encryption_configuration: '{{ remove_encryption_configuration }}'
remove_output_location: '{{ remove_output_location }}'
remove_expected_bucket_owner: '{{ remove_expected_bucket_owner }}'
remove_acl_configuration: '{{ remove_acl_configuration }}'
remove_bytes_scanned_cutoff_per_query: '{{ remove_bytes_scanned_cutoff_per_query }}'
engine_version: null
additional_configuration: null
execution_role: null
customer_content_encryption_configuration: null
remove_customer_content_encryption_configuration: '{{ remove_customer_content_encryption_configuration }}'
managed_query_results_configuration: null
- name: state
value: '{{ state }}'
- name: recursive_delete_option
value: '{{ recursive_delete_option }}'
UPDATE example
Use the following StackQL query and manifest file to update a work_group resource, using stack-deploy.
/*+ update */
UPDATE awscc.athena.work_groups
SET PatchDocument = string('{{ {
"Description": description,
"Tags": tags,
"State": state,
"RecursiveDeleteOption": recursive_delete_option
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ name }}';
DELETE example
/*+ delete */
DELETE FROM awscc.athena.work_groups
WHERE
Identifier = '{{ name }}' AND
region = 'us-east-1';
Permissions
To operate on the work_groups resource, the following permissions are required:
- Create
- Read
- List
- Delete
- Update
athena:CreateWorkGroup,
athena:TagResource,
iam:PassRole,
s3:GetBucketLocation,
s3:GetObject,
s3:ListBucket,
s3:ListBucketMultipartUploads,
s3:AbortMultipartUpload,
s3:PutObject,
s3:ListMultipartUploadParts,
kms:Decrypt,
kms:GenerateDataKey
athena:GetWorkGroup,
athena:ListTagsForResource
athena:ListWorkGroups
athena:DeleteWorkGroup,
athena:GetWorkGroup,
athena:UntagResource
athena:UpdateWorkGroup,
athena:TagResource,
athena:UntagResource,
iam:PassRole,
s3:GetBucketLocation,
s3:GetObject,
s3:ListBucket,
s3:ListBucketMultipartUploads,
s3:AbortMultipartUpload,
s3:PutObject,
s3:ListMultipartUploadParts,
kms:Decrypt,
kms:GenerateDataKey