File tree Expand file tree Collapse file tree 3 files changed +12
-6
lines changed
terraform/account-wide-infrastructure/modules/athena Expand file tree Collapse file tree 3 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -4,8 +4,8 @@ resource "aws_athena_database" "reporting-db" {
44 bucket = aws_s3_bucket. target-data-bucket . bucket
55
66# encryption_configuration {
7- # encryption_option = var.encryption_option
8- # kms_key = var.kms_key_arn
7+ # encryption_option = "SSE_KMS"
8+ # kms_key = aws_kms_key.athena.arn
99# }
1010
1111 force_destroy = true
@@ -19,14 +19,13 @@ resource "aws_athena_workgroup" "athena" {
1919 publish_cloudwatch_metrics_enabled = true
2020
2121 result_configuration {
22- output_location = " s3://{aws_s3_bucket.example .bucket}/output/"
22+ output_location = " s3://{aws_s3_bucket.athena .bucket}/output/"
2323
2424 encryption_configuration {
2525 encryption_option = " SSE_KMS"
26- kms_key_arn = var . kms_key_arn
26+ kms_key_arn = aws_kms_key . athena . arn
2727 }
2828 }
2929 }
3030
31- tags = var. common_tags
3231}
Original file line number Diff line number Diff line change 1+ resource "aws_kms_key" "athena" {
2+ }
3+
4+ resource "aws_kms_alias" "athena" {
5+ name = " alias/${ var . prefix } -athena"
6+ target_key_id = aws_kms_key. athena . key_id
7+ }
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ resource "aws_s3_bucket_server_side_encryption_configuration" "athena" {
88 rule {
99 apply_server_side_encryption_by_default {
1010 sse_algorithm = " aws:kms"
11- kms_master_key_id = var . kms_key_arn
11+ kms_master_key_id = aws_kms_key . athena . arn
1212 }
1313 }
1414
You can’t perform that action at this time.
0 commit comments