Open ggaller opened 1 year ago
@ggaller Thanks for submitting the feature request. This appears to be duplicate of https://github.com/aws/aws-lambda-dotnet/issues/1279 (which is also reviewed by the team). Please review and confirm if this ticket could be closed as duplicate.
Hi @ashishdhingra! I looked at the #1279 and it seems to be a similar, but much more complex. I know that the AWS team often implements services with partially overlapping functionality to better meet customer needs and maybe this is the case)) My solution serves to support compatibility with Lambda Invoke API no more and no less. By adding a controller with these endpoints:
[HttpPost("execute")]
public async Task<IActionResult> ExecuteFunction()
{...}
[HttpPost("execute/{functionName}")]
[HttpPost("2015-03-31/functions/{functionName}/invocations")]
public async Task<object> ExecuteFunction(string functionName)
{...}
Lambda Test Tool will be support for the standard lambda client from the AWS SDK
like this:
var client = new AmazonLambdaClient(new AmazonLambdaConfig
{
EndpointProvider = new StaticEndpointProvider("http://localhost:5050/invokeapi/")
});
With support of transferring not only payload, but also logs (LogType.Tail
) and errors similar like we get response from AWS.
What do you think of this approach?
Code is ready and I could have a PR ready tomorrow.
@ggaller Thanks for your response. Feel free to submit the PR which could be reviewed by the team.
@ashishdhingra PR #1349 is ready and waiting for the team's decision.
Hi @ashishdhingra. Any chance that the team looks at this issue and related PR?
Hi @normj!
I really appreciate what you do for .NET and enjoy using your tools. I also realise that you have a lot of tasks, but maybe you can spare a few minutes for this issue and related PR.
This is a very simple but important functionality that practically blurs the line between classic server-side solutions and the Lambda-based solution for local development and debugging.
We are now in the process of deciding how we want to start using local debugging and sharing it with our partners. The alternatives are to release a nuget package with a fork of Lambda Test Tool
or release a trimmed nuget package just for debugging, but I would really like to have a single Lambda Test Tool
that could be developed by AWS and the community together.
I hope to hear from you and have a nice day!
Hi @ggaller, Thank you for your contribution. I have one small remark, but besides that it looks good to me.
Hi @jeroenvervaeke, Thank you for your review. Added fix by your comments
Describe the feature
Adding http API to Lambda Test Tool as another way to call the function, along with web interface and CLI.
Use Case
In our games we build the server part on the Lambda function. With HTTP endpoint we could write a mock client and connect to the function running from the IDE with the possibility of debugging. It would be a normal local server listening on
localhost
.Proposed Solution
I prepared a simple example that works. This is a controller with route to execute endpoint. It used injected
LocalLambdaOptions
and select defaultLambdaConfigInfo
from it. Right now only payload is passed, but maybe we need to extend the api to be able to specify the function that we need to execute.Other Information
No response
Acknowledgements
AWS .NET SDK and/or Package version used
-
Targeted .NET Platform
.NET 6
Operating System and version
Windows, Linux, MacOS