⚡️ Now supported:
- $util.transform.toDynamoDBFilterExpression()
- $util.transform.toDynamoDBConditionExpression()
🤥 The AWS docs (go.aws/3PDlPCN) say they return a Map, but they actually return a String.
😶 toDynamoDBConditionExpression exists but is undocumented.
AWS AppSync added new VTL utility methods: $util.autoKsuid, $util.log.info and $util.log.error.
Mapping Tool now supports $util.autoKsuid() 🚀
This utility generates a "KSUID (K-Sortable Unique Identifier) base62 encoded as a String with a length of 27".
$util.log coming soon!
Sometimes it's hard to see the red/yellow/blue squiggly lines.
To make things easier, Mapping Tool now colors the margin and line number too! 🟥🟨🟦
Check out this contrived example:
One reason our emulation is so accurate is that we run the same VTL engine as AWS. Unfortunately that means Java, which can mean Lambda cold starts. 🥶
To keep things fun, if a cold start is detected, you can learn a phrase from one of 30 languages! 😀
Back in the RESPONSE template, we simply read our serialized string from the override and output it directly.
Like this: mappingtool.dev/app/apigatew…
Note: Lines 1 & 2 are just there to make Mapping Tool aware of the body property.
16/
So the fancy VTL processing should be done in the request template. Moreover, the processing needs to result in a string to be passed to the response.
We're going to need another trick!
And here it is: mappingtool.dev/app/apigatew…
14/
API Gateway keeps track of overrides between request & response templates, so the 'body' override will still be set in the response template.
However, overrides can only be strings and you probably want to process a complex JSON object (using '$input.path' etc.)
12/
Luckily there is a trick to get a value from the request template to the response template.
In the REQUEST template, we can put this VTL: mappingtool.dev/app/apigatew…
Usually this would override the 'body' URL path param used to call a real backend. We're using it as storage.
11/









