From b6cc69bb01762256a9228c060a269ddc7408010f Mon Sep 17 00:00:00 2001 From: mark roberts Date: Wed, 11 Oct 2023 09:18:20 +0100 Subject: [PATCH] changes for module code --- main.tf | 6 +++--- test/unit-test/main.tf | 1 + variables.tf | 5 +++++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/main.tf b/main.tf index 109c3882..1027af12 100644 --- a/main.tf +++ b/main.tf @@ -328,12 +328,12 @@ resource "aws_iam_role_policy_attachment" "lb_glue_servicec" { # Glue Crawler resource "aws_glue_crawler" "ssm_resource_sync" { - database_name = aws_athena_database.lb-access-logs[count.index] + database_name = aws_athena_database.lb-access-logs[0].name name = "lb_resource_sync" role = aws_iam_role.lb_glue_crawler.arn - schedule = "cron(15 1 ? * MON *)" + schedule = var.log_schedule s3_target { - path = "s3://${module.s3-bucket.bucket_name}" + path = "s3://${var.existing_bucket_name}" } } \ No newline at end of file diff --git a/test/unit-test/main.tf b/test/unit-test/main.tf index 389b8397..990c9193 100644 --- a/test/unit-test/main.tf +++ b/test/unit-test/main.tf @@ -76,4 +76,5 @@ module "lb_access_logs_enabled" { idle_timeout = 60 force_destroy_bucket = true lb_target_groups = local.lb_target_groups + log_schedule = "cron(15 1 ? * MON *)" } diff --git a/variables.tf b/variables.tf index 6ed8214b..5ec5266c 100644 --- a/variables.tf +++ b/variables.tf @@ -118,4 +118,9 @@ variable "lb_target_groups" { })), []) })) default = {} +} +variable "log_schedule" { + type = string + default = "cron(15 1 ? * MON *)" + } \ No newline at end of file