diff --git a/terraform/addons/monitoring/main.tf b/terraform/addons/monitoring/main.tf index c5b748406c71..122b8bc95d47 100644 --- a/terraform/addons/monitoring/main.tf +++ b/terraform/addons/monitoring/main.tf @@ -444,7 +444,7 @@ data "aws_iam_policy_document" "cron_monitoring_lambda" { resource "aws_cloudwatch_log_group" "cron_monitoring_lambda" { count = var.cron_monitoring == null ? 0 : 1 name = "/aws/lambda/${var.customer_prefix}-cron-monitoring" - retention_in_days = 7 + retention_in_days = var.cron_monitoring.log_retention_in_days } diff --git a/terraform/addons/monitoring/variables.tf b/terraform/addons/monitoring/variables.tf index b433e7343c70..4416feec630e 100644 --- a/terraform/addons/monitoring/variables.tf +++ b/terraform/addons/monitoring/variables.tf @@ -68,7 +68,8 @@ variable "cron_monitoring" { subnet_ids = list(string) rds_security_group_id = string delay_tolerance = string - run_interval = string + run_interval = string + log_retention_in_days = optional(number, 7) }) default = null }