pulse-vadc / terraform-provider-vtm

A terraform provider from the Pulse Secure virtual Traffic Manager
Mozilla Public License 2.0
9 stars 12 forks source link

Resource References from within a rule body. #9

Closed anantk007 closed 5 years ago

anantk007 commented 5 years ago

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.

ndavidson-pulse commented 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.

ndavidson-pulse commented 5 years ago

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.

ndavidson-pulse commented 5 years ago

I'm going to close this issue, assuming that the advice was helpful enough.