There's a great blog post on the AWS blogs that talk through how to deploy .NET with the CDK ☺️ aws.amazon.com/blogs/modernizing-with-aws/build-package-publish-dotnet-csharp-lambda-functions-aws-cdk/
Hey James, great video. Question, I have done everything apart from set up a proxy. When I try to access the weatherforecast route I get a 404 and the following error when invoking from visual studio { "errorType": "NullReferenceException", "errorMessage": "Object reference not set to an instance of an object.", "stackTrace": [ "at Amazon.Lambda.AspNetCoreServer.APIGatewayHttpApiV2ProxyFunction.MarshallRequest(InvokeFeatures features, APIGatewayHttpApiV2ProxyRequest apiGatewayRequest, ILambdaContext lambdaContext)", "at Amazon.Lambda.AspNetCoreServer.AbstractAspNetCoreFunction`2.FunctionHandlerAsync(TREQUEST request, ILambdaContext lambdaContext)", "at Amazon.Lambda.RuntimeSupport.HandlerWrapper.c__DisplayClass26_0`2.d.MoveNext()", "--- End of stack trace from previous location ---", "at Amazon.Lambda.RuntimeSupport.LambdaBootstrap.InvokeOnceAsync(CancellationToken cancellationToken)" ] } Is this due to the proxy not being set up?
Great question Andy! What exactly are you passing as the input payload when you're invoking the function from Visual Studio? Under the hood, the AWS tooling is translating what it's expecting to be an API Gateway input payload into a request it can pass to ASP.NET (that's what the marshall request method does). If you invoke the function with say, a string of 'Hello World' that deseriailzed object will be null, causing an object reference error. If you @ me on twitter I can send a quick video