Skip to main content

Logging

Overview​

The logging variable controls where the Upwind components send their logs. By default, the module creates a CloudWatch log group and sends the logs of the sensor, scanner, and cluster manager to it.

AttributeTypeDefaultDescription
cloudwatch_log_group.enabledbooltrueWhether the module creates the log group.
cloudwatch_log_group.namestring""The log group name. When empty, it is /aws/ecs/upwind/<ecs_cluster_name>.
cloudwatch_log_group.retention_in_daysnumber1The log retention in days.
log_configurationanynullA custom ECS log configuration. When set, the module creates no log group.

CloudWatch log group​

Change the name and retention of the log group:

module "upwind_ecs_runtime" {
source = "https://get.upwind.io/terraform/modules/aws-ecs-runtime/aws-ecs-runtime-1.5.1.tar.gz"

ecs_cluster_name = "my-ecs-cluster"
vpc_id = "vpc-0123456789abcdef0"
subnets = ["subnet-0123456789abcdef0", "subnet-0fedcba9876543210"]

credentials = {
client_id = var.upwind_client_id
client_secret = var.upwind_client_secret
}

logging = {
cloudwatch_log_group = {
name = "/aws/ecs/upwind/my-ecs-cluster"
retention_in_days = 14
}
}
}

Custom log configuration​

To use another log driver, set log_configuration. The module passes it to the containers as their ECS logConfiguration, and creates no log group. Use logDriver and options as the keys.

logging = {
log_configuration = {
logDriver = "awslogs"
options = {
"awslogs-group" = "/my/existing/log-group"
"awslogs-region" = "us-east-1"
"awslogs-stream-prefix" = "upwind"
}
}
}

If you set cloudwatch_log_group.enabled = false and no log_configuration, the components have no log configuration.