AWS::Athena::WorkGroup - Amazon CloudFormation
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).


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.


To declare this entity in your Amazon CloudFormation template, use the following syntax:


{ "Type" : "AWS::Athena::WorkGroup", "Properties" : { "Description" : String, "Name" : String, "RecursiveDeleteOption" : Boolean, "State" : String, "Tags" : [ Tag, ... ], "WorkGroupConfiguration" : WorkGroupConfiguration } }


Type: AWS::Athena::WorkGroup Properties: Description: String Name: String RecursiveDeleteOption: Boolean State: String Tags: - Tag WorkGroupConfiguration: WorkGroupConfiguration



The workgroup description.

Required: No

Type: String

Minimum: 0

Maximum: 1024

Update requires: No interruption


The workgroup name.

Required: Yes

Type: String

Pattern: [a-zA-Z0-9._-]{1,128}

Update requires: Replacement


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


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


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


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.


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.


The date and time the workgroup was created, as a UNIX timestamp in seconds. For example: 1582761016.


Property description not available.


The Athena engine version for running queries, or the PySpark engine version for running sessions.


Creating an Athena WorkGroup

The following example template creates the Athena WorkGroup MyCustomWorkGroup. Note the use of WorkGroupConfiguration to specify the configuration for the WorkGroup.


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/


{ "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/" } } } } } }

Updating an Athena WorkGroup

The following example template updates the Athena WorkGroup MyCustomWorkGroup. Note the use of WorkGroupConfigurationUpdates instead of WorkGroupConfiguration.


Resources: MyAthenaWorkGroup: Type: AWS::Athena::WorkGroup Properties: Name: MyCustomWorkGroup Description: My WorkGroup Updated State: DISABLED Tags: - Key: "key1" Value: "value1" - Key: "key2" Value: "value2" WorkGroupConfigurationUpdates: BytesScannedCutoffPerQuery: 10000000 EnforceWorkGroupConfiguration: true PublishCloudWatchMetricsEnabled: true RequesterPaysEnabled: false ResultConfigurationUpdates: EncryptionConfiguration: EncryptionOption: SSE_S3 OutputLocation: s3://path/to/my/bucket/updated/


{ "Resources":{ "MyAthenaWorkGroup":{ "Type":"AWS::Athena::WorkGroup", "Properties":{ "Name":"MyCustomWorkGroup", "Description":"My WorkGroup Updated", "State":"DISABLED", "Tags":[ { "Key":"key1", "Value":"value1" }, { "Key":"key2", "Value":"value2" } ], "WorkGroupConfigurationUpdates":{ "BytesScannedCutoffPerQuery":10000000, "EnforceWorkGroupConfiguration":true, "PublishCloudWatchMetricsEnabled":true, "RequesterPaysEnabled":false, "ResultConfigurationUpdates":{ "EncryptionConfiguration":{ "EncryptionOption":"SSE_S3" }, "OutputLocation":"s3://path/to/my/bucket/updated/" } } } } } }