Mapping Tool (@mappingtool) header
Mapping Tool (@mappingtool) profile picture

Professional VTL editor and debugger — Quickly build and debug AppSync & API Gateway mapping templates

Joined September 2021
Enjoyed your trial but put off by the price? Well, Mapping Tool is now 25% cheaper! 🤗
1
5
⚡️ 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.
1
4
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!
1
2
1
15
To make defining missing context data easier, relevant problem messages now say which tab to use ⚡️
1
2
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:
1
5
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! 😀
1
3
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/
1
1
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/
1
1
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/
1
1
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/
1
1