Skip to content

Resource: awsAthenaWorkgroup

Provides an Athena Workgroup.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.athenaWorkgroup.AthenaWorkgroup(this, "example", {
  configuration: {
    enforceWorkgroupConfiguration: true,
    publishCloudwatchMetricsEnabled: true,
    resultConfiguration: {
      encryptionConfiguration: {
        encryptionOption: "SSE_KMS",
        kmsKeyArn: "${aws_kms_key.example.arn}",
      },
      outputLocation: "s3://${aws_s3_bucket.example.bucket}/output/",
    },
  },
  name: "example",
});

Argument Reference

The following arguments are supported:

  • name - (Required) Name of the workgroup.
  • configuration - (Optional) Configuration block with various settings for the workgroup. Documented below.
  • description - (Optional) Description of the workgroup.
  • state - (Optional) State of the workgroup. Valid values are disabled or enabled. Defaults to enabled.
  • tags - (Optional) Key-value map of resource tags for the workgroup. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
  • forceDestroy - (Optional) Option to delete the workgroup and its contents even if the workgroup contains any named queries.

Configuration

  • bytesScannedCutoffPerQuery - (Optional) Integer for the upper data usage limit (cutoff) for the amount of bytes a single query in a workgroup is allowed to scan. Must be at least 10485760.
  • enforceWorkgroupConfiguration - (Optional) Boolean whether the settings for the workgroup override client-side settings. For more information, see Workgroup Settings Override Client-Side Settings. Defaults to true.
  • engineVersion - (Optional) Configuration block for the Athena Engine Versioning. For more information, see Athena Engine Versioning. See Engine Version below.
  • executionRole - (Optional) Role used in a notebook session for accessing the user's resources.
  • publishCloudwatchMetricsEnabled - (Optional) Boolean whether Amazon CloudWatch metrics are enabled for the workgroup. Defaults to true.
  • resultConfiguration - (Optional) Configuration block with result settings. See Result Configuration below.
  • requesterPaysEnabled - (Optional) If set to true , allows members assigned to a workgroup to reference Amazon S3 Requester Pays buckets in queries. If set to false , workgroup members cannot query data from Requester Pays buckets, and queries that retrieve data from Requester Pays buckets cause an error. The default is false . For more information about Requester Pays buckets, see Requester Pays Buckets in the Amazon Simple Storage Service Developer Guide.

Engine Version

  • selectedEngineVersion - (Optional) Requested engine version. Defaults to auto.

Result Configuration

  • encryptionConfiguration - (Optional) Configuration block with encryption settings. See Encryption Configuration below.
  • aclConfiguration - (Optional) That an Amazon S3 canned ACL should be set to control ownership of stored query results. See ACL Configuration below.
  • expectedBucketOwner - (Optional) AWS account ID that you expect to be the owner of the Amazon S3 bucket.
  • outputLocation - (Optional) Location in Amazon S3 where your query results are stored, such as s3://path/to/query/bucket/. For more information, see Queries and Query Result Files.
ACL Configuration
  • s3AclOption - (Required) Amazon S3 canned ACL that Athena should specify when storing query results. Valid value is BUCKET_OWNER_FULL_CONTROL.
Encryption Configuration
  • encryptionOption - (Required) Whether Amazon S3 server-side encryption with Amazon S3-managed keys (SSE_S3), server-side encryption with KMS-managed keys (SSE_KMS), or client-side encryption with KMS-managed keys (CSE_KMS) is used. If a query runs in a workgroup and the workgroup overrides client-side settings, then the workgroup's setting for encryption is used. It specifies whether query results must be encrypted, for all queries that run in this workgroup.
  • kmsKeyArn - (Optional) For SSE_KMS and CSE_KMS, this is the KMS key ARN.

Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • arn - ARN of the workgroup
  • configuration - Configuration block with various settings for the workgroup
  • engineVersion - Configuration block for the Athena Engine Versioning
    • effectiveEngineVersion - The engine version on which the query runs. If selectedEngineVersion is set to auto, the effective engine version is chosen by Athena.
  • id - Workgroup name
  • tagsAll - Map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.

Import

Athena Workgroups can be imported using their name, e.g.,

$ terraform import aws_athena_workgroup.example example