From ca74fcdcacb61fccebe66fe796d28ab6caa68f3b Mon Sep 17 00:00:00 2001 From: kylegalbraith Date: Tue, 21 Nov 2023 11:05:37 +0100 Subject: [PATCH] make retention for cloudwatch logs an optional parameter --- main.tf | 2 +- variables.tf | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 0817bf6..8968bf2 100644 --- a/main.tf +++ b/main.tf @@ -381,7 +381,7 @@ resource "aws_iam_role" "cloud-agent" { resource "aws_cloudwatch_log_group" "connection" { count = var.create ? 1 : 0 name = "depot-connection-${var.connection-id}" - retention_in_days = 7 + retention_in_days = var.cloud-agent-log-retention } resource "aws_ssm_parameter" "connection-token" { diff --git a/variables.tf b/variables.tf index 95b2685..0d4829e 100644 --- a/variables.tf +++ b/variables.tf @@ -24,6 +24,12 @@ variable "cloud-agent-version" { default = "2" } +variable "cloud-agent-log-retention" { + type = number + description = "Number of days to keep cloudwatch logs for the cloud-agent" + default = 7 +} + variable "create" { type = bool description = "Controls if Depot connection resources should be created"