using System.Collections.Generic; using System.Net.Http; using System.Text.Json; using System.Threading.Tasks; using Amazon.Lambda.Core; using Amazon.Lambda.APIGatewayEvents; // Assembly attribute to enable the Lambda function's JSON input to be converted into a .NET class. [assembly: LambdaSerializer(typeof(Amazon.Lambda.Serialization.SystemTextJson.DefaultLambdaJsonSerializer))] namespace HelloWorld { public class FunctionWithOnlyLambdaContext { public async object Handler(ILambdaContext context) { var body = new Dictionary { { "message", "hello world" }, }; return new APIGatewayProxyResponse { Body = JsonSerializer.Serialize(body), StatusCode = 200, Headers = new Dictionary { { "Content-Type", "application/json" } } }; } } }