Skip to main content

work_groups

Creates, updates, deletes or gets a work_group resource or lists work_groups in a region

Overview

Namework_groups
TypeResource
DescriptionResource schema for AWS::Athena::WorkGroup
Idawscc.athena.work_groups

Fields

NameDatatypeDescription
namestringThe workGroup name.
descriptionstringThe workgroup description.
tagsarrayOne or more tags, separated by commas, that you want to attach to the workgroup as you create it
work_group_configurationobjectThe workgroup configuration
work_group_configuration_updatesobjectThe workgroup configuration update object
creation_timestringThe date and time the workgroup was created.
statestringThe state of the workgroup: ENABLED or DISABLED.
recursive_delete_optionbooleanThe option to delete the workgroup and its contents even if the workgroup contains any named queries.
regionstringAWS region.

For more information, see AWS::Athena::WorkGroup.

Methods

NameResourceAccessible byRequired Params
create_resourcework_groupsINSERTName, region
delete_resourcework_groupsDELETEIdentifier, region
update_resourcework_groupsUPDATEIdentifier, PatchDocument, region
list_resourceswork_groups_list_onlySELECTregion
get_resourcework_groupsSELECTIdentifier, region

SELECT examples

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 = '{{ region }}' AND
Identifier = '{{ name }}';

INSERT example

Use the following StackQL query and manifest file to create a new work_group resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.athena.work_groups (
Name,
region
)
SELECT
'{{ name }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.athena.work_groups
WHERE
Identifier = '{{ name }}' 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:

ParameterDescription
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 work_groups resource, the following permissions are required:

athena:CreateWorkGroup,
athena:TagResource,
iam:PassRole,
s3:GetBucketLocation,
s3:GetObject,
s3:ListBucket,
s3:ListBucketMultipartUploads,
s3:AbortMultipartUpload,
s3:PutObject,
s3:ListMultipartUploadParts,
kms:Decrypt,
kms:GenerateDataKey