Way to repeat a set of literal arguments

Hi there. My use case is that the provider I’m using has two different resources that share extremely similar options (Azure Frontdoor Web Application Firewall and Azure Application Gateway Web Application Firewall), however they don’t seem to supply a way to repeat these configurations across these two resources through a link.

Is there a way to have a block of options repeated? I’ve tried local variable buts it doesn’t like nested blocks (it wants a map with ‘=’), and I’ve tried with modules but I don’t think I can just put a module inside a resource block (or at least, it’s saying “Blocks of type “module” are not expected here.”). Thanks

Hi @alexgagnon,

You can factor out the individual values into local values (potentially a single value of an object type) but there is no way to avoid writing out each of the arguments that belong inside a block, because Terraform statically validates the attributes and nested blocks inside a block before other expression evaluation.