Skip to content

Commit

Permalink
Merge pull request #13 from DNXLabs/feature/custom_cw_retention_period
Browse files Browse the repository at this point in the history
Adding custom retention period (in days) for Cloud Watch log group.
  • Loading branch information
DaisyMonte authored Jul 11, 2022
2 parents e45834f + 6d046ca commit 525136d
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 @@ -47,6 +47,7 @@ The following resources will be created:
| autoscaling\_default\_cooldown | The amount of time, in seconds, after a scaling activity completes before another scaling activity can start. | `number` | `300` | no |
| autoscaling\_health\_check\_grace\_period | The length of time that Auto Scaling waits before checking an instance's health status. The grace period begins when an instance comes into service. | `number` | `300` | no |
| backup | Assing a backup tag to efs resource - Backup will be performed by AWS Backup. | `string` | `"true"` | no |
| cw\_retention\_period | Retention period (in days) for Cloud Watch log group. Default to Never Expire. | `number` | `0` | no |
| domain\_name | Domain name to point to openvpn container for external access | `string` | `"vpn.address"` | no |
| hosted\_zone | Hosted Zone to create DNS record for this app | `string` | `""` | no |
| hosted\_zone\_id | Hosted Zone ID to create DNS record for this app (prefer this instead of hosted\_zone) | `string` | `""` | no |
Expand Down
5 changes: 5 additions & 0 deletions _variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,11 @@ variable "lb_access_logs_prefix" {
description = "Bucket prefix to store lb access logs."
}

variable "cw_retention_period" {
default = 0
description = "Retention period (in days) for Cloud Watch log group. Default to Never Expire."
}

variable "alb_ssl_policy" {
default = "ELBSecurityPolicy-2016-08"
type = string
Expand Down
2 changes: 2 additions & 0 deletions cloudwatch-task-logs.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
resource "aws_cloudwatch_log_group" "default" {
name = "ecs-openvpn-${var.name}"

retention_in_days = var.cw_retention_period
}

0 comments on commit 525136d

Please sign in to comment.