From b3eb56ff3119f23fcbe4ca3d804be4a3bdf187c0 Mon Sep 17 00:00:00 2001 From: Dominic Robinson Date: Tue, 19 Sep 2023 09:44:18 +0100 Subject: [PATCH] fix athena query --- main.tf | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/main.tf b/main.tf index 688c41bf..6a4103d2 100644 --- a/main.tf +++ b/main.tf @@ -198,9 +198,11 @@ resource "aws_athena_database" "lb-access-logs" { } resource "aws_athena_named_query" "main" { - count = var.access_logs ? 1 : 0 - name = "${var.application_name}-create-table" - database = aws_athena_database.lb-access-logs[0].name + count = var.access_logs ? 1 : 0 + name = "${var.application_name}-create-table" + database = aws_athena_database.lb-access-logs[0].name + workgroup = aws_athena_workgroup.lb-access-logs[0].id + query = templatefile( "${path.module}/templates/create_table.sql", {