Skip to content

The parser: parse the data structure sent by DynamoDB to Lambda using python

Notifications You must be signed in to change notification settings

abekthink/dynamodb-record-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

dynamodb-record-parser

the parser function

parse_dynamodb_record(): parse the data structure sent by DynamoDB to Lambda using python

invoke the function

parse_dynamodb_record(record)

input params

input params: a dynamodb record sent by the dynamodb trigger(lambda function)

record = {
    "SequenceNumber": "6321200000000003285225378",
    "Keys": {
        "key": {
            "S": "test123"
        }
    },
    "SizeBytes": 14330,
    "ApproximateCreationDateTime": 1476859080,
    "StreamViewType": "NEW_AND_OLD_IMAGES",
    "OldImage": {
        "integer": {
            "N": "123"
        },
        "string": {
            "S": "xxx"
        }
    },
    "NewImage": {
        "integer": {
            "N": "345"
        },
        "string": {
            "S": "zzz"
        }
    }
}

output result:

output result: the dictionary data in python

{
    "SequenceNumber": "6321200000000003285225378", 
    "OldImage": {
        "string": "xxx", 
        "integer": 123, 
    }, 
    "Keys": {
        "key": "test123"
    }, 
    "SizeBytes": 14330, 
    "NewImage": {
        "string": "zzz", 
        "integer": 345, 
    }, 
    "ApproximateCreationDateTime": 1476859080, 
    "StreamViewType": "NEW_AND_OLD_IMAGES"
}

About

The parser: parse the data structure sent by DynamoDB to Lambda using python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages