Skip to content

Commit

Permalink
Add support for tagging team
Browse files Browse the repository at this point in the history
  • Loading branch information
rotciw committed Sep 10, 2024
1 parent 395c225 commit 55df026
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,12 @@ locals {
datadog_layer_name_base = "arn:aws:lambda:${data.aws_region.current.name}:${local.datadog_account_id}:layer"
datadog_layer_suffix = lookup(local.architecture_layer_suffix_map, var.architectures[0])

combined_tags = format("%s,team:%s", coalesce(var.custom_datadog_tags, ""), coalesce(var.team_name, ""))
combined_tags = (
var.custom_datadog_tags == null && var.team_name == null
) ? "" : join(",", compact([
var.custom_datadog_tags,
var.team_name != null ? format("team:%s", var.team_name) : null
]))

environment_variables = {
common = {
Expand All @@ -76,7 +81,7 @@ locals {
DD_API_KEY_SECRET_ARN = data.aws_secretsmanager_secret.datadog_api_key.arn
DD_SITE = "datadoghq.eu"
DD_TRACE_ENABLED = "true"
DD_TAGS = local.combined_tags
DD_TAGS = nonsensitive(local.combined_tags)
}
runtime = lookup(local.runtime_base_environment_variable_map, local.runtime_base, {})
}
Expand Down

0 comments on commit 55df026

Please sign in to comment.