Skip to content

Commit

Permalink
feat(logging): Add log retention configuration
Browse files Browse the repository at this point in the history
Ref: #24
  • Loading branch information
pgcrooks-sysdig committed Aug 16, 2024
1 parent fb9b95f commit 0eb3d51
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ No modules.
| <a name="input_agent_log_level"></a> [agent\_log\_level](#input\_agent\_log\_level) | Orchestrator agent log level | `string` | `"info"` | no |
| <a name="input_cpu"></a> [cpu](#input\_cpu) | Task CPU allocation | `string` | `"2048"` | no |
| <a name="input_memory"></a> [cpu](#input\_memory) | Task memory allocation | `string` | `"8192"` | no |
| <a name="input_log_retention_days"></a> [log\_retention\_days](#input\_log\_retention\_days) | Task log retention period in days | `string` | `"0"` | no |

## Outputs

Expand Down
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ resource "aws_ecs_cluster" "orchestrator_agent" {

resource "aws_cloudwatch_log_group" "orchestrator_agent" {
name = "${var.name}-logs"
retention_in_days = var.log_retention_days

tags = merge(var.tags, var.default_tags)
}
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,9 @@ variable "memory" {
type = string
default = "8192"
}

variable "log_retention_days" {
description = "Cloudwatch log group retention in days. See https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_log_group#retention_in_days for acceptable values"
type = string
default = "0"
}

0 comments on commit 0eb3d51

Please sign in to comment.