aws / aws/aws-lambda-go

Migrate type of Keys, NewImage and OldImage in DynamoDBStreamRecord to dynamodb.AttributeValue

Open
#58 11 comments 38 reactions 0 assignees View on GitHub
design enhancement help wanted
Dominant language
Go
Stars
3.8k
Forks
578
Avg merge
8h 18m
Merged PRs (30d)
1

Description

Keys, NewImage and OldImage in [DynamoDBStreamRecord][1] currently have an internal [DynamoDBAttributeValue][2] type, however this is virtually the same type as [AttributeValue][3] in "github.com/aws/aws-sdk-go/service/dynamodb" but "less usable" since it doesn't have the convenience method, like Marshal and Unmarshal.

As @cmello [pointed out][4] in #54, aws-lambda-go doesn't depend on said package at the moment but I think we should explore the idea of either migrating the type and importing the SDK as a dependency, or copying the sub-packages over to this repo (don't like this idea), so we can have the same level of functionality.

For those wondering (@moedeveloper) what to do in the meantime, I found the following solution to be working quite well: https://gist.github.com/morcmarc/35194b39184977c2c44eb9fe063889a3

[1]: https://github.com/aws/aws-lambda-go/blob/master/events/dynamodb.go#L68
[2]: https://github.com/aws/aws-lambda-go/blob/master/events/attributevalue.go#L16
[3]: https://docs.aws.amazon.com/sdk-for-go/api/service/dynamodb/dynamodbattribute/
[4]: https://github.com/aws/aws-lambda-go/issues/54#issuecomment-373241955

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.