Advice for creating new variable substitutions

Does anyone have any advice on the best way to create a new set of variable substitutions for individual projects?

I see that terraspace uses the concept of expanders, but since my Ruby experience is limited, I’m not sure how to add a new expander to my project.

This post may help. TS_ENV custom variable on backend It explains how variable expansion works.

  1. As mentioned in the post, am considering making expanders automatically consider env vars.
  2. Also, this question inspires another thought. Considering providing a way to add custom variable substitutions.

Will consider PRs. Of course no sweat either way. :+1: Hope to get to it in time :clock1: The post should at least give some guidance.

Thanks @tung… I think what I’m looking for is point #2.

We’ve run into a problem with our resource naming when we include :LOCATION since this string can be relatively long and some resource names have length restrictions.

My hope was that I could map each location to a shortened version. I’d prefer to not do this externally (ie: via env variables).

I would love to be able to help by submitting a PR, but I have no Ruby experience at all. :frowning:

Note: In latest version of terraspace_plugin_azure a LOCATION_HASH variable is available. Docs Backend Config Variables - Terraspace