Skip to content

Commit

Permalink
Set docker label in prep for switching to default logging in Graviton…
Browse files Browse the repository at this point in the history
… clusters
  • Loading branch information
keirbadger committed Jan 17, 2024
1 parent 3c09a9b commit 97965ac
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ module "service_container_definition" {
version = "2.2.0"

name = "${var.release["component"]}${var.name_suffix}"
image = "${var.image_id != "" ? var.image_id : var.release["image_id"]}"
image = var.image_id != "" ? var.image_id : var.release["image_id"]
cpu = var.cpu
privileged = var.privileged
memory = var.memory
Expand Down Expand Up @@ -85,10 +85,11 @@ module "service_container_definition" {

labels = merge(
{
"component" = var.release["component"]
"env" = var.env
"team" = var.release["team"]
"version" = var.release["version"]
"component" = var.release["component"]
"env" = var.env
"team" = var.release["team"]
"version" = var.release["version"]
"com.datadoghq.ad.logs" = "[{\"source\": \"amazon_ecs\", \"service\": \"${local.full_service_name}\"}]"
},
var.container_labels,
)
Expand Down Expand Up @@ -159,10 +160,10 @@ resource "aws_appautoscaling_scheduled_action" "scale_back_up" {
}

resource "aws_appautoscaling_policy" "task_scaling_policy" {
for_each = {
for index, scale in var.scaling_metrics:
scale.metric => scale
}
for_each = {
for index, scale in var.scaling_metrics :
scale.metric => scale
}
name = each.value.name
policy_type = "TargetTrackingScaling"
resource_id = aws_appautoscaling_target.ecs.resource_id
Expand All @@ -179,4 +180,4 @@ resource "aws_appautoscaling_policy" "task_scaling_policy" {
predefined_metric_type = each.value.metric
}
}
}
}

0 comments on commit 97965ac

Please sign in to comment.