work_groups
Creates, updates, deletes, gets or lists a work_groups resource.
Overview
| Name | work_groups |
| Type | Resource |
| Id | aws.athena.work_groups |
Fields
The following fields are returned by SELECT queries:
- get_work_group
- list_work_groups
| Name | Datatype | Description |
|---|---|---|
configuration | object | The configuration of the workgroup, which includes the location in Amazon S3 where query and calculation results are stored, the encryption configuration, if any, used for query and calculation results; whether the Amazon CloudWatch Metrics are enabled for the workgroup; whether workgroup settings override client-side settings; and the data usage limits for the amount of data scanned per query or per workgroup. The workgroup settings override is specified in EnforceWorkGroupConfiguration (true/false) in the WorkGroupConfiguration. See WorkGroupConfiguration$EnforceWorkGroupConfiguration. |
creation_time | string (date-time) | The date and time the workgroup was created. |
description | string | The workgroup description. |
identity_center_application_arn | string | The ARN of the IAM Identity Center enabled application associated with the workgroup. (pattern: <code>^arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b):sso::\d{12}:application/(sso)?ins-[a-zA-Z0-9-.]{16}/apl-[a-zA-Z0-9]{16}$</code>) |
name | string | The workgroup name. (pattern: <code>[a-zA-Z0-9._-]{1,128}</code>) |
state | string | The state of the workgroup: ENABLED or DISABLED. (ENABLED, DISABLED) |
| Name | Datatype | Description |
|---|---|---|
next_token | string | A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call. |
work_groups | array | A list of WorkGroupSummary objects that include the names, descriptions, creation times, and states for each workgroup. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_work_group | select | region | Returns information about the workgroup with the specified name. | |
list_work_groups | select | region | Lists available workgroups for the account. | |
create_work_group | insert | region, Name | Creates a workgroup with the specified name. A workgroup can be an Apache Spark enabled workgroup or an Athena SQL workgroup. | |
update_work_group | update | region, WorkGroup | Updates the workgroup with the specified name. The workgroup's name cannot be changed. Only ConfigurationUpdates can be specified. | |
delete_work_group | delete | region | Deletes the workgroup with the specified name. The primary workgroup cannot be deleted. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- get_work_group
- list_work_groups
Returns information about the workgroup with the specified name.
SELECT
configuration,
creation_time,
description,
identity_center_application_arn,
name,
state
FROM aws.athena.work_groups
WHERE region = '{{ region }}' -- required
;
Lists available workgroups for the account.
SELECT
next_token,
work_groups
FROM aws.athena.work_groups
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_work_group
- Manifest
Creates a workgroup with the specified name. A workgroup can be an Apache Spark enabled workgroup or an Athena SQL workgroup.
INSERT INTO aws.athena.work_groups (
Name,
Configuration,
Description,
Tags,
region
)
SELECT
'{{ Name }}' /* required */,
'{{ Configuration }}',
'{{ Description }}',
'{{ Tags }}',
'{{ region }}'
;
# Description fields are for documentation purposes
- name: work_groups
props:
- name: region
value: "{{ region }}"
description: Required parameter for the work_groups resource.
- name: Name
value: "{{ Name }}"
description: |
The workgroup name.
- name: Configuration
description: |
Contains configuration information for creating an Athena SQL workgroup or Spark enabled Athena workgroup. Athena SQL workgroup configuration includes the location in Amazon S3 where query and calculation results are stored, the encryption configuration, if any, used for encrypting query results, whether the Amazon CloudWatch Metrics are enabled for the workgroup, the limit for the amount of bytes scanned (cutoff) per query, if it is specified, and whether workgroup's settings (specified with EnforceWorkGroupConfiguration) in the WorkGroupConfiguration override client-side settings. See WorkGroupConfiguration$EnforceWorkGroupConfiguration.
value:
ResultConfiguration:
OutputLocation: "{{ OutputLocation }}"
EncryptionConfiguration:
EncryptionOption: "{{ EncryptionOption }}"
KmsKey: "{{ KmsKey }}"
ExpectedBucketOwner: "{{ ExpectedBucketOwner }}"
AclConfiguration:
S3AclOption: "{{ S3AclOption }}"
ManagedQueryResultsConfiguration:
Enabled: {{ Enabled }}
EncryptionConfiguration:
KmsKey: "{{ KmsKey }}"
EnforceWorkGroupConfiguration: {{ EnforceWorkGroupConfiguration }}
PublishCloudWatchMetricsEnabled: {{ PublishCloudWatchMetricsEnabled }}
BytesScannedCutoffPerQuery: {{ BytesScannedCutoffPerQuery }}
RequesterPaysEnabled: {{ RequesterPaysEnabled }}
EngineVersion:
SelectedEngineVersion: "{{ SelectedEngineVersion }}"
EffectiveEngineVersion: "{{ EffectiveEngineVersion }}"
AdditionalConfiguration: "{{ AdditionalConfiguration }}"
ExecutionRole: "{{ ExecutionRole }}"
MonitoringConfiguration:
CloudWatchLoggingConfiguration:
Enabled: {{ Enabled }}
LogGroup: "{{ LogGroup }}"
LogStreamNamePrefix: "{{ LogStreamNamePrefix }}"
LogTypes: "{{ LogTypes }}"
ManagedLoggingConfiguration:
Enabled: {{ Enabled }}
KmsKey: "{{ KmsKey }}"
S3LoggingConfiguration:
Enabled: {{ Enabled }}
KmsKey: "{{ KmsKey }}"
LogLocation: "{{ LogLocation }}"
EngineConfiguration:
CoordinatorDpuSize: {{ CoordinatorDpuSize }}
MaxConcurrentDpus: {{ MaxConcurrentDpus }}
DefaultExecutorDpuSize: {{ DefaultExecutorDpuSize }}
AdditionalConfigs: "{{ AdditionalConfigs }}"
SparkProperties: "{{ SparkProperties }}"
Classifications:
- Name: "{{ Name }}"
Properties: "{{ Properties }}"
CustomerContentEncryptionConfiguration:
KmsKey: "{{ KmsKey }}"
EnableMinimumEncryptionConfiguration: {{ EnableMinimumEncryptionConfiguration }}
IdentityCenterConfiguration:
EnableIdentityCenter: {{ EnableIdentityCenter }}
IdentityCenterInstanceArn: "{{ IdentityCenterInstanceArn }}"
QueryResultsS3AccessGrantsConfiguration:
EnableS3AccessGrants: {{ EnableS3AccessGrants }}
CreateUserLevelPrefix: {{ CreateUserLevelPrefix }}
AuthenticationType: "{{ AuthenticationType }}"
- name: Description
value: "{{ Description }}"
description: |
The workgroup description.
- name: Tags
description: |
A list of comma separated tags to add to the workgroup that is created.
value:
- Key: "{{ Key }}"
Value: "{{ Value }}"
UPDATE examples
- update_work_group
Updates the workgroup with the specified name. The workgroup's name cannot be changed. Only ConfigurationUpdates can be specified.
UPDATE aws.athena.work_groups
SET
WorkGroup = '{{ WorkGroup }}',
Description = '{{ Description }}',
ConfigurationUpdates = '{{ ConfigurationUpdates }}',
State = '{{ State }}'
WHERE
region = '{{ region }}' --required
AND WorkGroup = '{{ WorkGroup }}' --required;
DELETE examples
- delete_work_group
Deletes the workgroup with the specified name. The primary workgroup cannot be deleted.
DELETE FROM aws.athena.work_groups
WHERE region = '{{ region }}' --required
;