0

I am attempting to follow this tutorial for setting up a WebSocket API using Amazon API Gatewway:

https://medium.com/@gavinlewis/getting-started-with-websockets-on-api-gateway-with-net-and-the-serverless-framework-9065f37d06e0

Like in the tutorial, my Lambda application is written in C# with classes for Connect, Disconnect, etc.

Unlike the tutorial, I am using the AWS website to set up the Gateway API. This is where I am stuck. I can't figure out how to "map" the $connect, $disconnect, echo, etc using the website UI:

enter image description here

I am not sure what the format of the value for the "Lambda Function" textbox. It is probably similar to this (from tutorial) but, I get a validation error when I use this value:

CsharpHandlers::App.Disconnect::FunctionHandler

So, what is the proper value I should enter to reference my lambda application, a specific class and a specific method?

Thanks.

Orion
  • 215
  • 2
  • 7
  • When you go to your lambda function you should see the ARN in the top right corner looking something like ARN - arn:aws:lambda:us-east-1:some_numbers:function:lambda_name_here – GSazheniuk Dec 03 '19 at 17:34
  • @GSazheniuk I see that and that works. However, that maps to the default handler. How do I map it to a specific class.method within that lambda? Or is it not possible? – Orion Dec 03 '19 at 17:51
  • I am not sure if what you are asking for is possible. Lambda functions are supposed to be simple, I have only used python for lambdas, but I guess it is same for C#. Every lambda represents only one function, with one entry point. I suggest you should break your logic into multiple lambda functions, one for each class.method, but I might be wrong, lets see if anyone else has any better answer. – GSazheniuk Dec 03 '19 at 18:00

1 Answers1

0

In the Lambda Function form field you need to put the ARN of the function you want to proxy the request to.

To modify a Lambda function's default handler, open it in the AWS Management Console, and look for the Handler field under the Function code section (e.g. LambdaTest::LambdaTest.LambdaHandler::handleRequest). Even if you change it tho, you would need to stick to the signature described in the docs.