Skip to content

Commit

Permalink
Configure cloudwatch logs retention days for the workers
Browse files Browse the repository at this point in the history
  • Loading branch information
amarouane-ABDELHAK committed Jun 12, 2024
1 parent 63ce413 commit c83c6c3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion infrastructure/ecs_services/airflow_worker.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Send worker logs to this Cloud Watch log group

resource "aws_cloudwatch_log_group" "airflow_worker" {
name_prefix = "/${var.prefix}/airflow-worker/"
retention_in_days = 1
retention_in_days = var.workers_logs_retention_days
}


Expand Down
4 changes: 4 additions & 0 deletions infrastructure/ecs_services/varaibles.tf
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,7 @@ variable "worker_cmd" {

variable "subdomain" {
}

variable "workers_logs_retention_days" {
type = number
}
1 change: 1 addition & 0 deletions infrastructure/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ module "ecs_services" {
stage = var.stage
worker_cmd = var.worker_cmd
subdomain = var.subdomain
workers_logs_retention_days = var.workers_logs_retention_days
}

resource "null_resource" "airflow_create_airflow_user" {
Expand Down
5 changes: 5 additions & 0 deletions infrastructure/varaibles.tf
Original file line number Diff line number Diff line change
Expand Up @@ -178,4 +178,9 @@ variable "rds_max_allocated_storage" {
variable "extra_airflow_configuration" {
type = map(any)
default = {}
}

variable "workers_logs_retention_days" {
type = number
default = 1
}

0 comments on commit c83c6c3

Please sign in to comment.