Skip to content

Commit 9b90d54

Browse files
committed
add : athena workgroup with custom configuration
1 parent 7c42d51 commit 9b90d54

File tree

4 files changed

+31
-0
lines changed

4 files changed

+31
-0
lines changed

locals.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
locals {
2+
query_results_bucket_location = "s3://${var.query_results_bucket}/output/"
3+
}

main.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
resource "aws_athena_workgroup" "this" {
2+
name = var.workgroup_name
3+
force_destroy = true
4+
5+
configuration {
6+
publish_cloudwatch_metrics_enabled = false
7+
8+
result_configuration {
9+
output_location = local.query_results_bucket_location
10+
}
11+
}
12+
}

variables.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
variable "workgroup_name" {
2+
description = "(Required) Name of the workgroup"
3+
type = string
4+
}
5+
6+
variable "query_results_bucket" {
7+
description = "The S3 bucket where Athena query results will be stored."
8+
type = string
9+
}

versions.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
terraform {
22
required_version = ">= 1.8.4"
3+
4+
required_providers {
5+
aws = {
6+
source = "hashicorp/aws"
7+
version = "~> 5.0"
8+
}
9+
}
310
}

0 commit comments

Comments
 (0)