File tree Expand file tree Collapse file tree 4 files changed +67
-0
lines changed
terraform/account-wide-infrastructure/modules/athena Expand file tree Collapse file tree 4 files changed +67
-0
lines changed Original file line number Diff line number Diff line change 1+ resource "aws_athena_database" "reporting-db" {
2+ name = var. database
3+
4+ bucket = aws_s3_bucket. target-data-bucket . bucket
5+
6+ # encryption_configuration {
7+ # encryption_option = var.encryption_option
8+ # kms_key = var.kms_key_arn
9+ # }
10+
11+ force_destroy = true
12+ }
13+
14+ resource "aws_athena_workgroup" "athena" {
15+ name = var. name_prefix
16+
17+ configuration {
18+ enforce_workgroup_configuration = true
19+ publish_cloudwatch_metrics_enabled = true
20+
21+ result_configuration {
22+ output_location = " s3://{aws_s3_bucket.example.bucket}/output/"
23+
24+ encryption_configuration {
25+ encryption_option = " SSE_KMS"
26+ kms_key_arn = var. kms_key_arn
27+ }
28+ }
29+ }
30+
31+ tags = var. common_tags
32+ }
Original file line number Diff line number Diff line change 1+ output "workgroup" {
2+ value = aws_athena_workgroup. athena
3+ }
4+
5+ output "bucket" {
6+ value = aws_s3_bucket. athena
7+ }
8+
9+ output "database" {
10+ value = aws_athena_database. reporting-db
11+ }
Original file line number Diff line number Diff line change 1+ resource "aws_s3_bucket" "athena" {
2+ bucket = " athena"
3+ }
4+
5+
6+ resource "aws_s3_bucket_server_side_encryption_configuration" "athena" {
7+ bucket = aws_s3_bucket. athena . bucket
8+ rule {
9+ apply_server_side_encryption_by_default {
10+ sse_algorithm = " aws:kms"
11+ kms_master_key_id = var. kms_key_arn
12+ }
13+ }
14+
15+ }
Original file line number Diff line number Diff line change 1+ variable "database" {
2+ description = " What the db will be called"
3+ default = " NRL-Reporting"
4+ }
5+
6+ variable "name_prefix" {
7+ type = string
8+ description = " The prefix to apply to all resources in the module."
9+ }
You can’t perform that action at this time.
0 commit comments