From f5ac9cccc2b44d0746a8e6a9ff68ea3c18ffcf86 Mon Sep 17 00:00:00 2001 From: Andre Narciso <37899965+andrenarciso4@users.noreply.github.com> Date: Fri, 14 Jun 2024 09:23:00 +0100 Subject: [PATCH] add log level to datadog (#99) --- terraform/datadog.tf | 13 +++++++------ terraform/templates/datadog-agent.json.tpl | 4 ++++ terraform/variables.tf | 4 ++++ 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/terraform/datadog.tf b/terraform/datadog.tf index ed5344e..f0742f8 100644 --- a/terraform/datadog.tf +++ b/terraform/datadog.tf @@ -12,12 +12,13 @@ resource "aws_ecs_task_definition" "datadog" { network_mode = "awsvpc" requires_compatibilities = ["FARGATE"] container_definitions = templatefile("${path.module}/templates/datadog-agent.json.tpl", { - AWS_REGION = data.aws_region.current.name - DD_API_KEY = var.datadog_api_key - DD_APM_ENV = var.datadog_env - STATS_URL = var.datadog_stats_url - IMAGE = var.datadog_image - VERSION = var.datadog_image_version + AWS_REGION = data.aws_region.current.name + DD_API_KEY = var.datadog_api_key + DD_APM_ENV = var.datadog_env + STATS_URL = var.datadog_stats_url + IMAGE = var.datadog_image + VERSION = var.datadog_image_version + DD_LOG_LEVEL = var.datadog_log_level }) } diff --git a/terraform/templates/datadog-agent.json.tpl b/terraform/templates/datadog-agent.json.tpl index 72d248c..c10c94d 100644 --- a/terraform/templates/datadog-agent.json.tpl +++ b/terraform/templates/datadog-agent.json.tpl @@ -28,6 +28,10 @@ { "name": "DD_APM_ENV", "value": "${DD_APM_ENV}" + }, + { + "name": "DD_LOG_LEVEL", + "value": "${DD_LOG_LEVEL}" } ] } diff --git a/terraform/variables.tf b/terraform/variables.tf index b6ea598..105afbe 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -222,6 +222,10 @@ variable "datadog_image_version" { description = "datadog agent image version" default = "latest" } +variable "datadog_log_level" { + description = "datadog log level" + default = "INFO" +} variable "datadog_count" { description = "datadog service count" default = "2"