Skip to content

How to convert DynamoDBEvent images to DynamoDBv2.Document #1657

Open
@dscpinheiro

Description

@dscpinheiro

Discussed in #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:

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 #1648 is merged.
Could anyone suggest what is the easiest way to do same after the update?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions