Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DynamoDB WingLib will not deploy to AWS without startingPosition, but this is not documented #7178

Open
boyney123 opened this issue Sep 30, 2024 · 5 comments
Labels
☁️ aws Related to Amazon Web Services support 📚 documentation Improvements or additions to documentation ✨ enhancement New feature or request needs-discussion Further discussion is needed prior to impl

Comments

@boyney123
Copy link
Contributor

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

  • Please vote by adding a 👍 reaction to the issue to help us prioritize.
  • If you are interested to work on this issue, please leave a comment.
  • If this issue is labeled needs-discussion, it means the spec has not been finalized yet. Please reach out on the #dev channel in the Wing Discord.
@boyney123 boyney123 added ✨ enhancement New feature or request needs-discussion Further discussion is needed prior to impl 📚 documentation Improvements or additions to documentation labels Sep 30, 2024
@Chriscbr
Copy link
Contributor

@boyney123 Can you include an example or the error message in full?

@Chriscbr Chriscbr added the ☁️ aws Related to Amazon Web Services support label Sep 30, 2024
@boyney123
Copy link
Contributor Author

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?

@Chriscbr
Copy link
Contributor

Default to LATEST sounds reasonable.

@boyney123
Copy link
Contributor Author

Will try and make the change

@boyney123
Copy link
Contributor Author

OK PR open winglang/winglibs#324

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
☁️ aws Related to Amazon Web Services support 📚 documentation Improvements or additions to documentation ✨ enhancement New feature or request needs-discussion Further discussion is needed prior to impl
Projects
None yet
Development

No branches or pull requests

2 participants