From d8d41cbdcd2da166327d83c30f7e92740d843512 Mon Sep 17 00:00:00 2001 From: pguti778 <71953686+pguti778@users.noreply.github.com> Date: Tue, 2 Mar 2021 22:09:41 -0300 Subject: [PATCH] AWS: Change Default environment values I've faced the "The key must start with a letter and can only contain letters, numbers, and underscores." issue in the AWS lambda. So both _HANDLER and spring.cloud.function.definition were not enabled to be added as environment variables. Let me know your thoughts. --- .../cloud/function/adapter/aws/CustomRuntimeEventLoop.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-cloud-function-adapters/spring-cloud-function-adapter-aws/src/main/java/org/springframework/cloud/function/adapter/aws/CustomRuntimeEventLoop.java b/spring-cloud-function-adapters/spring-cloud-function-adapter-aws/src/main/java/org/springframework/cloud/function/adapter/aws/CustomRuntimeEventLoop.java index 2cab7436b..554265398 100644 --- a/spring-cloud-function-adapters/spring-cloud-function-adapter-aws/src/main/java/org/springframework/cloud/function/adapter/aws/CustomRuntimeEventLoop.java +++ b/spring-cloud-function-adapters/spring-cloud-function-adapter-aws/src/main/java/org/springframework/cloud/function/adapter/aws/CustomRuntimeEventLoop.java @@ -122,7 +122,7 @@ public class CustomRuntimeEventLoop { } private static FunctionInvocationWrapper locateFunction(FunctionCatalog functionCatalog, MediaType contentType) { - String handlerName = System.getenv("_HANDLER"); + String handlerName = System.getenv("DEFAULT_HANDLER"); FunctionInvocationWrapper function = functionCatalog.lookup(handlerName, contentType.toString()); if (function == null) { handlerName = System.getenv("spring.cloud.function.definition");