Using VTL to transform AWS Lambda response with Amazon API Gateway

API Gateway → AWS Lambda

Use VTL template to transform JSON response to xml in Amazon API Gateway.

This template shows an example of API Gateway transforms the JSON response from Lambda and returns XML using VTL.

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub


Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/apigw-lambda-json-xml-vtl-transformation

Deploy

sam deploy


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

Delete the stack: sam delete --stack-name STACK_NAME.
Confirm the stack has been deleted: aws cloudformation list-stacks --query "StackSummaries[?contains(StackName,'STACK_NAME')].StackStatus"

Created by:

Vamsi Krishna Ganti

Cloud Consultant at AWS focusing on Application Development.