AWS::Athena::WorkGroup
The AWS::Athena::WorkGroup resource specifies an Amazon Athena workgroup, which contains a name, description, creation time, state, and other configuration, listed under WorkGroupConfiguration. Each workgroup enables you to isolate queries for you or your group from other queries in the same account. For more information, see CreateWorkGroup in the Amazon Athena API Reference.
Syntax
To declare this entity in your AWS CloudFormation template, use the following syntax:
JSON
{ "Type" : "AWS::Athena::WorkGroup", "Properties" : { "Description" :
String
, "Name" :String
, "RecursiveDeleteOption" :Boolean
, "State" :String
, "Tags" :[ Tag, ... ]
, "WorkGroupConfiguration" :WorkGroupConfiguration
} }
YAML
Type: AWS::Athena::WorkGroup Properties: Description:
String
Name:String
RecursiveDeleteOption:Boolean
State:String
Tags:- Tag
WorkGroupConfiguration:WorkGroupConfiguration
Properties
Description
-
The workgroup description.
Required: No
Type: String
Minimum:
0
Maximum:
1024
Update requires: No interruption
Name
-
The workgroup name.
Required: Yes
Type: String
Pattern:
[a-zA-Z0-9._-]{1,128}
Update requires: Replacement
RecursiveDeleteOption
-
The option to delete a workgroup and its contents even if the workgroup contains any named queries. The default is false.
Required: No
Type: Boolean
Update requires: No interruption
State
-
The state of the workgroup: ENABLED or DISABLED.
Required: No
Type: String
Allowed values:
ENABLED | DISABLED
Update requires: No interruption
-
The tags (key-value pairs) to associate with this resource.
Required: No
Type: Array of Tag
Update requires: No interruption
WorkGroupConfiguration
-
The configuration of the workgroup, which includes the location in Amazon S3 where query results are stored, the encryption option, if any, used for query results, whether Amazon CloudWatch Metrics are enabled for the workgroup, and the limit for the amount of bytes scanned (cutoff) per query, if it is specified. The EnforceWorkGroupConfiguration option determines whether workgroup settings override client-side query settings.
Required: No
Type: WorkGroupConfiguration
Update requires: No interruption
Return values
Ref
When you pass the logical ID of this resource to the intrinsic Ref
function, Ref
returns the name of the WorkGroup. For example:
{ "Ref": "myWorkGroup" }
For more information about using the Ref
function, see Ref
.
Fn::GetAtt
The Fn::GetAtt
intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.
For more information about using the Fn::GetAtt
intrinsic function, see Fn::GetAtt
.
CreationTime
-
The date and time the workgroup was created, as a UNIX timestamp in seconds. For example:
1582761016
. WorkGroupConfiguration.EngineVersion.EffectiveEngineVersion
Property description not available.
WorkGroupConfigurationUpdates.EngineVersion.EffectiveEngineVersion
-
The Athena engine version for running queries, or the PySpark engine version for running sessions.
Examples
Create or update an Athena workgroup
The following example template creates or updates the Athena workgroup
MyCustomWorkGroup
.
JSON
{ "Resources":{ "MyAthenaWorkGroup":{ "Type":"AWS::Athena::WorkGroup", "Properties":{ "Name":"MyCustomWorkGroup", "Description":"My WorkGroup", "State":"ENABLED", "Tags":[ { "Key":"key1", "Value":"value1" }, { "Key":"key2", "Value":"value2" } ], "WorkGroupConfiguration":{ "BytesScannedCutoffPerQuery":200000000, "EnforceWorkGroupConfiguration":false, "PublishCloudWatchMetricsEnabled":false, "RequesterPaysEnabled":true, "ResultConfiguration":{ "OutputLocation":"s3://path/to/my/bucket/" } } } } } }
YAML
Resources: MyAthenaWorkGroup: Type: AWS::Athena::WorkGroup Properties: Name: MyCustomWorkGroup Description: My WorkGroup State: ENABLED Tags: - Key: "key1" Value: "value1" - Key: "key2" Value: "value2" WorkGroupConfiguration: BytesScannedCutoffPerQuery: 200000000 EnforceWorkGroupConfiguration: false PublishCloudWatchMetricsEnabled: false RequesterPaysEnabled: true ResultConfiguration: OutputLocation: s3://path/to/my/bucket/