Open bsamartins opened 4 years ago
Even more. Right now AWS Console does not allow Lambda Environment variable to have dots in it's name. (only letters, numbers, underscore). So, in order to define function name in lambda config we need another property name (e.g. micronautFunctionName or functionName).
Workaround working for me:
public class CustomMicronautRequestStreamHandler extends MicronautRequestStreamHandler {
@Override
protected String resolveFunctionName(Environment env) {
return env.getProperty("functionName", String.class, (String) null);
}
}
Even more. Right now AWS Console does not allow Lambda Environment variable to have dots in it's name. (only letters, numbers, underscore). So, in order to define function name in lambda config we need another property name (e.g. micronautFunctionName or functionName).
You should be able to use MICRONAUT_FUNCTION_NAME
.
When running function in SAM with MicronautRequestStreamHandler,
micronaut.function.name
is ignored by the handler.MicronautRequestStreamHandler takes, by default, the function name from the Lambda context. Because function name is populated it never evaluates the configuration property, not allowing the name to be overriden.