-
Notifications
You must be signed in to change notification settings - Fork 475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing documentation on running AOT lambdas in test tool #1539
Comments
@SamuelCox Thanks for reporting the issue. Please refer to https://github.com/aws/aws-lambda-dotnet/blob/master/Tools/LambdaTestTool/README.md#testing-executable-assemblies for testing Native AOT Lambda functions. These are compiled as executable assemblies. More information can be found in the test tool documentation available at http://localhost:5050/documentation (this is the endpoint after Test tool is launched). Please let me know if it helps. Thanks, |
@SamuelCox Here are the updated steps working for me:
{
"profiles": {
"LambdaNativeAOT": {
"commandName": "Project",
"environmentVariables": {
"AWS_LAMBDA_RUNTIME_API": "localhost:5050",
"AWS_PROFILE": "default",
"AWS_REGION": "us-east-2"
}
}
}
}
Breakpoint in Visual Studio should be hit now. I agree the Lambda Test Tool documentation needs to be elaborated or made more clear. Thanks, |
Lambda Test Tool documentation (accessible at after launching the tool) is quite elaborate to explain steps for debugging. Hence, closing this issue. Test Executable Assembly Functions.NET Lambda functions can be written as an executable assembly. This is done for Lambda functions using custom runtime or using .NET top level statements. These functions include the Lambda runtime client implemented in the Amazon.Lambda.RuntimeSupport NuGet package. In an executable assembly function the Lambda runtime client is initialized and connects to a local REST endpoint for Lambda events to process. The Executable Assembly page in this tool hosts a local Lambda runtime API for the Lambda runtime client to connect to. On this page you can queue events for the Lambda function to process. Connect Executable Assembly FunctionsTo test Lambda function built as an executable assembly the environment variable AWS_LAMBDA_RUNTIME_API must be set to localhost:5050. This will tell Amazon.Lambda.RuntimeSupport to connect to this instance of the test tool for Lambda events to process. To configure AWS credentials and region for the function the environment variables AWS_PROFILE and AWS_REGION can be set. Here is an example of a .NET executable assembly Lambda function's launchSettings.json file used in Visual Studio for debugging that connects to the test tool and sets the profile and region. { "profiles": { "Lambda Runtime API": { "commandName": "Project", "environmentVariables": { "AWS_LAMBDA_RUNTIME_API": "localhost:5050", "AWS_PROFILE": "test-profile", "AWS_REGION": "us-west-2" } } } } Programmatically Queue EventsTo queue an event to be processed without using the UI send a POST request to http://localhost:5050/runtime/test-event with the JSON Lambda event document as the POST request's body. |
Lambda Test tool Readme at Testing Executable Assemblies has been updated to add steps for debugging executable assemblies. |
Comments on closed issues are hard for our team to see. |
Describe the issue
As far as I can tell, there is no proper documentation on how to use the lambda test tool for .net 7 AOT
throws this error:
If I listen to the error message (which every amazon sample on line uses "bootstrap" as the handler for aot) then I get this
Would massively appreciate proper documentation on this and/or a description of what I'm doing wrong
Links
https://github.com/aws/aws-lambda-dotnet/blob/master/Tools/LambdaTestTool/README.md
The text was updated successfully, but these errors were encountered: