Closed boyney123 closed 3 weeks ago
@boyney123 Can you include an example or the error message in full?
Yeah sure
here is the error
Error: creating Lambda Event Source Mapping (arn:aws:dynamodb:us-east-1:654654508474:table/SpacesTable/stream/2024-09-30T10:24:17.260): operation error Lambda: CreateEventSourceMapping, https response error StatusCode: 400, RequestID: 497bc8b2-d962-4f09-bb50-187a59a3e650, InvalidParameterValueException: 1 validation error detected: Value null at 'startingPosition' failed to satisfy constraint: Member must not be null.
So a DDB stream to a Lambda function
This example won't work as the startingPosition is not defined.
db.setStreamConsumer(inflight (record: dynamodb.StreamRecord) => {
// LOGIC....
});
This works
db.setStreamConsumer(inflight (record: dynamodb.StreamRecord) => {
// LOGIC....
}, { startingPosition: "LATEST" });
@Chriscbr what you think? Should we default this value for folks in in the winglib? Maybe default to LATEST? Or somehow give them errors to help them at least?
Default to LATEST sounds reasonable.
Will try and make the change
This is now merged, closing this issue
Use Case
Using the WingLib for DynamoDB trying to deploy my application to AWS with terraform. Says the startingPosition is required, but nothing states this in the documentation or examples.
Proposed Solution
Add missing docs.
Implementation Notes
No response
Component
No response
Community Notes