aws / aws/aws-lambda-dotnet

How to convert DynamoDBEvent images to DynamoDBv2.Document

Open
#1,657 18 comments 5 reactions 0 assignees View on GitHub
bug module/lambda-client-lib p2
Dominant language
C#
Stars
1.7k
Forks
503
Avg merge
1d 5h
Merged PRs (30d)
18

Description

### Discussed in https://github.com/aws/aws-lambda-dotnet/discussions/1654

Originally posted by **Dreamescaper** January 16, 2024
I have a lambda subscribed to dynamoDb events. I want to convert event's records to regular JSON, currently we use something like that:
```csharp
public async Task FunctionHandler(DynamoDBEvent input, ILambdaContext context)
{
foreach (var record in input.Records)
{
var image = record.Dynamodb.NewImage;
var document = Document.FromAttributeMap(image);
var json = document.ToJson();
/* .... */
}
}
```

However, it doesn't work after the https://github.com/aws/aws-lambda-dotnet/pull/1648 is merged.
Could anyone suggest what is the easiest way to do same after the update?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.