The Problem
You have built a .net core based AWS lambda package and now you wish to publish it.
Googling the internet you find that this can be done by running the following script:
|
1 |
dotnet lambda package -o ..\lambda-1.zip |
It throws the error: “dotnet : No executeable found matching command “dotnet-lambda”
The Issue
You Lambda project requires some special tools that provide the lambda packager.
The Solution
Edit your lambda text file and ensure that the following block exists as an item group
|
1 2 3 4 |
<itemgroup> <dotnetclitoolreference include="Amazon.Lambda.Tools" version="2.2.0"> </dotnetclitoolreference> </itemgroup> |
Restore the packages, (dotnet restore), and retry the “package” command and the lambda should now build and be packed into your lambda-1.zip file.
You can also apply the change by the dotnet cli running the following command
|
1 |
dotnet tool install --global Amazon.Lambda.Tools --version 3.3.1 |
The nuget package details are here:
https://www.nuget.org/packages/Amazon.Lambda.Tools
