Closed anantk007 closed 5 years ago
Hi anatk007 - I think it depends on your use-case. We already have customers using template_file data sources to render rules so I'd be interested to know what problems you think you'd have with hundreds of rules?
If they all share a few templates then the number of variables should be small, if you're looking for a better way to organize repetitive configuration then a module with an included template might be worth considering.
You can of course always set the content of a rule to the data it contains and use variable interpolation as well, if that would be easier than juggling a data source for every template.
I'm going to close this issue, assuming that the advice was helpful enough.
Hello, Is there a way we could reference terraform resources from within a rule body ?
Example
if (string.startsWith ("/xyz")){ pool.use("PoolName") }
Now instead of hard-coding the pool-name , could terraform allow the pool resource to be referenced directly in some way ?
At the moment the only way to do this is pass the rule body to a template datasource and replace variables within it. However if a big cluster of traffic managers has hundreds of rules , the list of template variables could easily become unmanageable.