From 25e17da8e91c0d6394cd4b7a3d9b6d3be2c883e5 Mon Sep 17 00:00:00 2001 From: briskt <3172830+briskt@users.noreply.github.com> Date: Tue, 27 Aug 2024 20:56:29 +0800 Subject: [PATCH] add input log_retention_in_days --- main.tf | 2 +- test/test.tf | 1 + variables.tf | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/main.tf b/main.tf index e5eb48b..393f738 100644 --- a/main.tf +++ b/main.tf @@ -96,7 +96,7 @@ resource "aws_iam_user_policy" "cd" { */ resource "aws_cloudwatch_log_group" "logs" { name = local.app_name_and_env - retention_in_days = 30 + retention_in_days = var.log_retention_in_days } /* diff --git a/test/test.tf b/test/test.tf index 28f8d44..53c6759 100644 --- a/test/test.tf +++ b/test/test.tf @@ -43,6 +43,7 @@ module "full" { timeout = 10 unhealthy_threshold = 3 } + log_retention_in_days = 60 } provider "aws" { diff --git a/variables.tf b/variables.tf index 87f3a7b..5e46598 100644 --- a/variables.tf +++ b/variables.tf @@ -35,6 +35,12 @@ variable "create_dashboard" { type = bool } +variable "log_retention_in_days" { + description = "Number of days to retain CloudWatch application logs" + default = 30 + type = number +} + /* * DNS configuration