2
我的工作与从一个DynamoDB触发器触发了一些lambda函数的AWS无服务器应用程序...调试AWS无服务器lambda函数与DynamoDBEvents在C#
输入在DynamoDB表中的新记录基本上当。 ..it触发一个LamdaFunction,它读入DynamoDBEvent参数中新记录的参数,然后执行一些业务逻辑并将数据写入另一个DynamoDBEvents参数。
我该如何调试才能看到如何从DynamoDBEvents参数中获取值?或者我可以用什么策略来实现我想要做的事情?
有没有办法将Visual Studio Test项目中的DynamoDBEvent模拟到本地的所有函数?
public APIGatewayProxyResponse AddUserTask(DynamoDBEvent dynamoEvent, ILambdaContext context)
{
foreach (var record in dynamoEvent.Records)
{
//do stuff with the values from the new record in the dynamoEvent parameter...
}
var returnObj = new { Success = true };
var response = new APIGatewayProxyResponse
{
StatusCode = (int)HttpStatusCode.OK,
Body = SerializeObject(returnObj),
Headers = new Dictionary<string, string> { { "Content-Type", "application/json" } }
};
return response;
}
感谢Udo .....有效......并且日志在CloudWatch中很好地显示! –