From 05e5c1ccbabf3aa59044792dc357af915a1aeb98 Mon Sep 17 00:00:00 2001 From: Felipe Narvaez Date: Mon, 11 Jul 2022 17:53:20 -0400 Subject: [PATCH 1/2] Fixed: invalid lambda function name --- main.tf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 3c753af9..dbd05239 100644 --- a/main.tf +++ b/main.tf @@ -2,7 +2,8 @@ locals { # next-tf config config_dir = trimsuffix(var.next_tf_dir, "/") config_file = jsondecode(file("${local.config_dir}/config.json")) - lambdas = lookup(local.config_file, "lambdas", {}) + plambdas = lookup(local.config_file, "lambdas", {}) + lambdas = { for k, v in local.plambdas : replace(k, "/[^a-zA-Z0-9-_]/", "_") => v} static_files_archive = "${local.config_dir}/${lookup(local.config_file, "staticFilesArchive", "")}" # Build the proxy config JSON From d39ca0615351af4ea0343c2d19560f5ea21d453c Mon Sep 17 00:00:00 2001 From: Felipe Narvaez Date: Thu, 14 Jul 2022 17:00:10 -0400 Subject: [PATCH 2/2] Refactoring to the lambda name --- main.tf | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/main.tf b/main.tf index dbd05239..acec358f 100644 --- a/main.tf +++ b/main.tf @@ -1,9 +1,10 @@ locals { # next-tf config - config_dir = trimsuffix(var.next_tf_dir, "/") - config_file = jsondecode(file("${local.config_dir}/config.json")) - plambdas = lookup(local.config_file, "lambdas", {}) - lambdas = { for k, v in local.plambdas : replace(k, "/[^a-zA-Z0-9-_]/", "_") => v} + config_dir = trimsuffix(var.next_tf_dir, "/") + config_file = jsondecode(file("${local.config_dir}/config.json")) + lambdas = { + for k, v in lookup(local.config_file, "lambdas", {}) : replace(k, "/[^a-zA-Z0-9-_]/", "_") => v + } static_files_archive = "${local.config_dir}/${lookup(local.config_file, "staticFilesArchive", "")}" # Build the proxy config JSON