Anyone happen to know if it's possible to create a...
# help
g
Anyone happen to know if it's possible to create a ULID (or any time sorted id) in appsync without having to use a lambda resolver? From docs it seems they only have UUID generate util.
j
I am using KSUID with AppSync resolvers. It is unfortunate but you will have to use Lambda resolvers for now. The AppSync team are working to release a replacement for VTL that will allow you to use JS functions much like CloudFront Functions. (Isolated) The issue with direct lambda resolvers seems to just be cold starts and slower execution. In my experience I have imperceptible time difference when using Golang and a lambda warmer to keep them hot.
It is not as easy to test VTLs so I’m glad to have made the switch. The cold start problem is the only thing required besides a runtime like Golang
t
@Joe Kendal where did you hear they're working on a VTL replacement
g
Also anyone looking for this I just made the ids time stamps šŸ˜…
Copy code
${util.time.nowISO8601()}-${util.autoId()}
Produces:
2022-01-03T22:11:44.127Z-7fb48205-cb0a-4b44-8f80-b397c90af85e
Not ideal for urls but you could base64 encode before sending it to users and remove the "==" and I think all will be fine on that front šŸ™‚