MCPcopy Index your code
hub / github.com/aws/aws-lambda-go / ExampleDynamoDBEvent

Function ExampleDynamoDBEvent

events/example_dynamodb_test.go:16–28  ·  view source on GitHub ↗

Stream notifications are delivered to the Lambda handler whenever data in the DynamoDB table is modified. Depending on the Stream settings, a StreamRecord may contain: - Keys: key attributes of the modified item - NewImage: the entire item, as it appears after it was modified - OldImage: the entire

()

Source from the content-addressed store, hash-verified

14// - NewImage: the entire item, as it appears after it was modified
15// - OldImage: the entire item, as it appeared before it was modified
16func ExampleDynamoDBEvent() {
17 lambda.Start(func(ctx context.Context, e *events.DynamoDBEvent) {
18 for _, record := range e.Records {
19 fmt.Printf("Processing request data for event ID %s, type %s.\n", record.EventID, record.EventName)
20
21 for name, value := range record.Change.NewImage {
22 if value.DataType() == events.DataTypeString {
23 fmt.Printf("Attribute name: %s, value: %s\n", name, value.String())
24 }
25 }
26 }
27 })
28}

Callers

nothing calls this directly

Calls 3

StartFunction · 0.92
DataTypeMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…