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 72bb712..5b58058 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 asg_tags = { foo = "bar", } diff --git a/variables.tf b/variables.tf index 8f2200e..a1ac16b 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