Skip to content

Commit d931201

Browse files
authored
Custom log retention (#27)
* make log retentin * Update readme
1 parent 82a59b0 commit d931201

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

README.md

+9
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,14 @@ Description: name of the cluster
272272

273273
Description: security group of the cluster
274274

275+
### log\_retention
276+
277+
Description: Log retention in days
278+
279+
Type: `number`
280+
281+
Default: `30`
282+
275283
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
276284
## Usage
277285

@@ -325,6 +333,7 @@ module "ecs" {
325333

326334
## Changelog
327335

336+
- 0.2.7 - Add custom value for log retention
328337
- 0.2.6 - Enable AWS ECS metadata file
329338
- 0.2.5 - Enable Datadog to collect APM logs
330339
- 0.2.4 - Removed deprecated `null_data_source`

logs.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
resource "aws_cloudwatch_log_group" "log_group" {
22
name = local.name
3-
retention_in_days = 30
3+
retention_in_days = var.log_retention
44
tags = local.tags
55
}

variables.tf

+5
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,11 @@ variable "ssh_key_name" {
9595
default = ""
9696
}
9797

98+
variable "log_retention" {
99+
description = "Log retention in Days"
100+
default = 30
101+
}
102+
98103
variable "instance_tags" {
99104
type = list(object({
100105
key = string

0 commit comments

Comments
 (0)