Skip to content

Commit b509289

Browse files
authored
[SVLS-7075] append datadog layer instead of prepend (#37)
1 parent ff6b8d6 commit b509289

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ locals {
6363
datadog_lambda_layer_version = lookup(local.runtime_base_layer_version_map, local.runtime_base, "")
6464

6565
datadog_account_id = (data.aws_partition.current.partition == "aws-us-gov") ? "002406178527" : "464622532012"
66-
datadog_layer_name_base = "arn:${data.aws_partition.current.partition}:lambda:${data.aws_region.current.name}:${local.datadog_account_id}:layer"
66+
datadog_layer_name_base = "arn:${data.aws_partition.current.partition}:lambda:${data.aws_region.current.region}:${local.datadog_account_id}:layer"
6767
datadog_layer_suffix = lookup(local.architecture_layer_suffix_map, var.architectures[0])
6868

6969
environment_variables = {
@@ -174,9 +174,9 @@ resource "aws_lambda_function" "this" {
174174
# Datadog layers are defined in single element lists
175175
# This allows for runtimes where a lambda layer is not needed by concatenating an empty list
176176
layers = concat(
177-
local.layers.extension,
177+
var.layers,
178178
local.layers.lambda,
179-
var.layers
179+
local.layers.extension,
180180
)
181181

182182
dynamic "logging_config" {

0 commit comments

Comments
 (0)