Description
Is the mock lambda test tool supposed to populate values in the ILambdaContext in my function handler?
Specifically, in my config file, I have function-timeout
set to 30 and function-memory-size
set to 512. I am expecting those to be populated in the ILambdaContext that gets passed in as RemainingTime
and MemoryLimitInMB
respectively, but they are just getting their defaults zero values.
This is problematic in my function as I set up a CancelationTokenSource that reserves a few seconds of RemainingTime
to gracefully shutdown. I have to add some special logic to account for the 0 value that tool passes in that I don't really want in my code.
{
"Information": [
"This file provides default values for the deployment wizard inside Visual Studio and the AWS Lambda commands added to the .NET Core CLI.",
"To learn more about the Lambda commands with the .NET Core CLI execute the following command at the command line in the project root directory.",
"dotnet lambda help",
"All the command line options for the Lambda command can be specified in this file."
],
"profile": "default",
"region": "us-east-2",
"configuration": "Debug",
"framework": "netcoreapp3.1",
"function-runtime": "dotnetcore3.1",
"function-memory-size": 512,
"function-timeout": 30,
"function-handler": "{assembly}::{namespace}.{class}::{method}"
}
Edit:
I think I found where the mocked LambdaContext is being created and this is supposed to be happening. Looks like nothing is being set yet though. Seems like it should be pretty easy to implement filing in the mocked LambdaContext from the config file.