0

Currently, we are using a json file which as a lambda layer. Is it possible to access this lambda layer in appsync template? There will be alot of field in this json file. It is something like this:


module.exports = {
    "INVALID_RFC": {"code": "111", "message": "RFC Code is invalid"}
}

I want to access this INVALID_RFC property from appsync template.

Shadab Faiz
  • 2,380
  • 1
  • 18
  • 28

1 Answers1

0

No, it is not possible for AppSync mapping templates.

I ran into a similar problem. My workaround is

  • Use placeholders in a mapping template, for example. $INVALID_RFC$
  • Write a simple script (NodeJS, Python, or bash) that copies original Velocity templates over a build directory, and also replaces the placeholders with actual values. It's done easily with regular expressions
  • Deploy built mapping templates into AWS
Hung Tran
  • 1,595
  • 2
  • 17
  • 17