How to make external file references more usable and configurable

I keep a collection of reusable AWS stateMachine configuration fragments in an external JSON file to promote a high-degree of code-reuse. For example, I can add retry and catch blocks from this external json with the references in yellow highlighter below:

My inquiry relates to the “Payload” reference highlighted in green which extracts the configuration value from “SessionResponse” property from the “model.json” file.

I would like to make the “SessionResponse” more configurable to allow the jsonPath to be passed in from the external file reference. In this example, the path is “$”. I would like to be able to pass in different jsonPath values to override or set them where the static “$” path is set.

Is it possible for one to do this? If so, what is the syntax?

Thank you,


Not sure how to do exactly what you specified, but I have seen examples where the included file is able to reference a e.g. custom variable from the including file.

The example I saw was here: GitHub - murali44/RDS-Aurora-Serverless: Aurora Serverless Deployment and Migration Demo. though the variables in the sub files didn’t all match up with those in the top level file the overall principle did work.

Thanks. Although I have moved on from this, I appreciate your suggestion and I will checkout the demo you linked.