.net - How to edit a Handler in an AWS Lambda template? - Stack Overflow

I built a lambda function in C#.After running dotnet publish, zipping everything up, and uploading it

I built a lambda function in C#. After running dotnet publish, zipping everything up, and uploading it in the dashboard, it isn't running because it seems to think that the function is located at LambdaTest::LambdaTest.LambdaHandler::handleRequest rather than inside the assembly I built.

I can see the value if I open the function's Template. But I can't edit it. It says "This AWS SAM template has been generated from your function's configuration" but I can't find that value anywhere in any piece of configuration I can see. It has an option to export the template to something called Infrastructure Composer, where I can go in and edit the template, but there doesn't appear to be any option in Infrastructure Composer to save my changes back to the original lambda function.

This should be incredibly straightforward, but I just don't see where the option is. How do I change this value?

I built a lambda function in C#. After running dotnet publish, zipping everything up, and uploading it in the dashboard, it isn't running because it seems to think that the function is located at LambdaTest::LambdaTest.LambdaHandler::handleRequest rather than inside the assembly I built.

I can see the value if I open the function's Template. But I can't edit it. It says "This AWS SAM template has been generated from your function's configuration" but I can't find that value anywhere in any piece of configuration I can see. It has an option to export the template to something called Infrastructure Composer, where I can go in and edit the template, but there doesn't appear to be any option in Infrastructure Composer to save my changes back to the original lambda function.

This should be incredibly straightforward, but I just don't see where the option is. How do I change this value?

Share Improve this question edited Mar 26 at 12:11 jarmod 79k18 gold badges130 silver badges135 bronze badges Recognized by AWS Collective asked Mar 26 at 4:29 Mason WheelerMason Wheeler 84.7k54 gold badges285 silver badges505 bronze badges 1
  • Perhaps related: stackoverflow/questions/74144256 – jarmod Commented Mar 26 at 12:14
Add a comment  | 

2 Answers 2

Reset to default 0

After a lot of searching around, I was never able to find a way to edit this successfully in the UI, but there is a way to do it in the AWS CLI:

aws lambda update-function-configuration --function-name [name] --handler "correct handler here"

Leaving this here just in case anyone needs this in the future.

You should have a "aws-lambda-tools-defaults.json" file under "src" folder zipped with your binary where you can specify configuration. This is an example configuration find in the documentation here.

 "profile" : "default",
  "region" : "us-east-2",
  "configuration" : "Release",
  "function-architecture": "x86_64",
  "function-runtime":"dotnet8",
  "function-memory-size" : 256,
  "function-timeout" : 30,
  "function-handler" : "myDotnetFunction::myDotnetFunction.Function::FunctionHandler"

I believe changing the function-handler property value to the correct one, and reuploading would suffice.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744165382a4561281.html

相关推荐

  • .net - How to edit a Handler in an AWS Lambda template? - Stack Overflow

    I built a lambda function in C#.After running dotnet publish, zipping everything up, and uploading it

    8天前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信