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 | aws.athena.work_groups |
Fields
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. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | Name, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, region |
SELECT
examples
Gets all work_groups
in a region.
SELECT
region,
name,
description,
tags,
work_group_configuration,
work_group_configuration_updates,
creation_time,
state,
recursive_delete_option
FROM aws.athena.work_groups
WHERE region = 'us-east-1';
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 aws.athena.work_groups
WHERE region = 'us-east-1' AND data__Identifier = '<Name>';
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 aws.athena.work_groups (
Name,
region
)
SELECT
'{{ Name }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.athena.work_groups (
Name,
Description,
Tags,
WorkGroupConfiguration,
WorkGroupConfigurationUpdates,
State,
RecursiveDeleteOption,
region
)
SELECT
'{{ Name }}',
'{{ Description }}',
'{{ Tags }}',
'{{ WorkGroupConfiguration }}',
'{{ WorkGroupConfigurationUpdates }}',
'{{ State }}',
'{{ RecursiveDeleteOption }}',
'{{ 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: WorkGroupConfiguration
value:
BytesScannedCutoffPerQuery: '{{ BytesScannedCutoffPerQuery }}'
EnforceWorkGroupConfiguration: '{{ EnforceWorkGroupConfiguration }}'
PublishCloudWatchMetricsEnabled: '{{ PublishCloudWatchMetricsEnabled }}'
RequesterPaysEnabled: '{{ RequesterPaysEnabled }}'
ResultConfiguration:
EncryptionConfiguration:
EncryptionOption: '{{ EncryptionOption }}'
KmsKey: '{{ KmsKey }}'
OutputLocation: '{{ OutputLocation }}'
ExpectedBucketOwner: '{{ ExpectedBucketOwner }}'
AclConfiguration:
S3AclOption: '{{ S3AclOption }}'
EngineVersion:
SelectedEngineVersion: '{{ SelectedEngineVersion }}'
EffectiveEngineVersion: '{{ EffectiveEngineVersion }}'
AdditionalConfiguration: '{{ AdditionalConfiguration }}'
ExecutionRole: '{{ ExecutionRole }}'
CustomerContentEncryptionConfiguration:
KmsKey: null
- name: WorkGroupConfigurationUpdates
value:
BytesScannedCutoffPerQuery: null
EnforceWorkGroupConfiguration: null
PublishCloudWatchMetricsEnabled: null
RequesterPaysEnabled: null
ResultConfigurationUpdates:
EncryptionConfiguration: null
OutputLocation: null
ExpectedBucketOwner: null
AclConfiguration: null
RemoveEncryptionConfiguration: '{{ RemoveEncryptionConfiguration }}'
RemoveOutputLocation: '{{ RemoveOutputLocation }}'
RemoveExpectedBucketOwner: '{{ RemoveExpectedBucketOwner }}'
RemoveAclConfiguration: '{{ RemoveAclConfiguration }}'
RemoveBytesScannedCutoffPerQuery: '{{ RemoveBytesScannedCutoffPerQuery }}'
EngineVersion: null
AdditionalConfiguration: null
ExecutionRole: null
CustomerContentEncryptionConfiguration: null
RemoveCustomerContentEncryptionConfiguration: '{{ RemoveCustomerContentEncryptionConfiguration }}'
- name: State
value: '{{ State }}'
- name: RecursiveDeleteOption
value: '{{ RecursiveDeleteOption }}'
DELETE
example
/*+ delete */
DELETE FROM aws.athena.work_groups
WHERE data__Identifier = '<Name>'
AND region = 'us-east-1';
Permissions
To operate on the work_groups
resource, the following permissions are required:
Create
athena:CreateWorkGroup,
athena:TagResource,
iam:PassRole,
s3:GetBucketLocation,
s3:GetObject,
s3:ListBucket,
s3:ListBucketMultipartUploads,
s3:AbortMultipartUpload,
s3:PutObject,
s3:ListMultipartUploadParts,
kms:Decrypt,
kms:GenerateDataKey
Read
athena:GetWorkGroup,
athena:ListTagsForResource
List
athena:ListWorkGroups
Delete
athena:DeleteWorkGroup,
athena:GetWorkGroup,
athena:UntagResource
Update
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