Skip to content

Commit a725590

Browse files
author
Om Sharma
authored
Merge pull request #30 from clouddrove/yaac
added retention_in_days
2 parents 8c430f0 + 93a2d36 commit a725590

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

_example/redis/example.tf

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ module "redis" {
5858
availability_zones = ["eu-west-1a", "eu-west-1b"]
5959
auto_minor_version_upgrade = true
6060
number_cache_clusters = 2
61+
retention_in_days = 0
6162

6263
log_delivery_configuration = [
6364
{

main.tf

+4-3
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ module "labels" {
2121
}
2222

2323
resource "aws_cloudwatch_log_group" "default" {
24-
count = var.enable && length(var.log_delivery_configuration) > 0 ? 1 : 0
25-
name = format("logs-%s", module.labels.id)
26-
tags = module.labels.tags
24+
count = var.enable && length(var.log_delivery_configuration) > 0 ? 1 : 0
25+
name = format("logs-%s", module.labels.id)
26+
retention_in_days = var.retention_in_days
27+
tags = module.labels.tags
2728
}
2829

2930
# Module : Elasticache Subnet Group

variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -241,3 +241,9 @@ variable "log_delivery_configuration" {
241241
default = []
242242
description = "The log_delivery_configuration block allows the streaming of Redis SLOWLOG or Redis Engine Log to CloudWatch Logs or Kinesis Data Firehose. Max of 2 blocks."
243243
}
244+
245+
variable "retention_in_days" {
246+
type = number
247+
default = 0
248+
description = "Specifies the number of days you want to retain log events in the specified log group."
249+
}

0 commit comments

Comments
 (0)