Skip to content

Commit 1a9c471

Browse files
authored
adds logs_retention_in_days variable defaulting to 90 days (#36)
1 parent 116942d commit 1a9c471

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

env/dev/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ $ terraform apply
6060
| internal | Whether the application is available on the public internet, also will determine which subnets will be used (public or private) | string | `true` | no |
6161
| lb_port | The port the load balancer will listen on | string | `80` | no |
6262
| lb_protocol | The load balancer protocol | string | `HTTP` | no |
63+
| logs_retention_in_days | Specifies the number of days you want to retain log events | int | 90 | no |
6364
| logz_token | The auth token to use for sending logs to Logz.io | string | - | yes |
6465
| logz_url | The endpoint to use for sending logs to Logz.io | string | `https://listener.logz.io:8071` | no |
6566
| private_subnets | The private subnets, minimum of 2, that are a part of the VPC(s) | string | - | yes |

env/dev/ecs.tf

+7-1
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,14 @@ resource "aws_iam_role_policy_attachment" "ecsTaskExecutionRole_policy" {
176176
policy_arn = "arn:aws:iam::aws:policy/service-role/AmazonECSTaskExecutionRolePolicy"
177177
}
178178

179+
variable "logs_retention_in_days" {
180+
type = number
181+
default = 90
182+
description = "Specifies the number of days you want to retain log events"
183+
}
184+
179185
resource "aws_cloudwatch_log_group" "logs" {
180186
name = "/fargate/service/${var.app}-${var.environment}"
181-
retention_in_days = "14"
187+
retention_in_days = var.logs_retention_in_days
182188
tags = var.tags
183189
}

0 commit comments

Comments
 (0)