Skip to content

Commit

Permalink
Merge pull request #154 from dxw/fix-athena-result-output-location
Browse files Browse the repository at this point in the history
Fix Athena result output location
  • Loading branch information
Stretch96 authored Sep 5, 2024
2 parents 1738eb9 + b1862ba commit e17d364
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ resource "aws_athena_workgroup" "infrastructure_ecs_cluster_service_cloudfront_l
publish_cloudwatch_metrics_enabled = true

result_configuration {
output_location = "s3://${aws_s3_bucket.infrastructure_logs[0].bucket}/${local.resource_prefix}-infrastructure-ecs-cluster-service-${each.key}-logs"
output_location = "s3://${aws_s3_bucket.infrastructure_logs[0].bucket}/${local.logs_bucket_athena_result_output_dir}/${local.resource_prefix}-infrastructure-ecs-cluster-service-${each.key}-cloudfront-logs"

encryption_configuration {
encryption_option = local.infrastructure_kms_encryption ? "SSE_KMS" : "SSE_S3"
Expand Down
1 change: 1 addition & 0 deletions locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ locals {
logs_bucket_logs_source_arns = concat(
local.infrastructure_vpc_flow_logs_s3_with_athena ? ["arn:aws:logs:${local.aws_region}:${local.aws_account_id}:*"] : []
)
logs_bucket_athena_result_output_dir = "athena-result-output"

route53_root_hosted_zone_domain_name = var.route53_root_hosted_zone_domain_name
aws_profile_name_route53_root = var.aws_profile_name_route53_root
Expand Down
2 changes: 1 addition & 1 deletion vpc-infrastructure-flow-logs-athena.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ resource "aws_athena_workgroup" "infrastructure_vpc_flow_logs" {
publish_cloudwatch_metrics_enabled = true

result_configuration {
output_location = "s3://${aws_s3_bucket.infrastructure_logs[0].bucket}/${local.infrastructure_vpc_flow_logs_s3_key_prefix}-athena-output"
output_location = "s3://${aws_s3_bucket.infrastructure_logs[0].bucket}/${local.logs_bucket_athena_result_output_dir}/${local.infrastructure_vpc_flow_logs_s3_key_prefix}-vpcflowlogs"

encryption_configuration {
encryption_option = local.infrastructure_kms_encryption ? "SSE_KMS" : "SSE_S3"
Expand Down

0 comments on commit e17d364

Please sign in to comment.