You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there any way to assign the contents of a dynamic block by passing in a single variable that defines its contents? For example, with an Azure App Service there is a site_config block, which has a lot of arguments. I would like to declare a variable named site_config of type any and set the contents of the dynamic block to equal my variable.
Instead of
I have a similar annoying experience with AWS WAFv2, which changed their resource definitions and instead of being able to set a simple interpolated value for the default action property now we have to define a nested block.
I don't know the syntax which will allow to interpolate the name of the block which could make that simple. In WAFv2 that's 'allow' or 'block'. I've found a workaround but it's ugly. It requires 6 lines (for 2 possible values) instead of 1 interpolated line.
What probably was an improvement over how final JSON looks and simplify it a bit resulted in a burden in Terraform code.
I have the same frustrating experience with site_config in Azure function app service. I'd need to assign a dynamic map to the content. The syntax proposed by dvishniakov is an elegant and simple solution.
Generally, this seems to be a serious limitation of the block construct. I wonder why there are just a few people tracking this issue.
Is there any way to assign the contents of a dynamic block by passing in a single variable that defines its contents? For example, with an Azure App Service there is a site_config block, which has a lot of arguments. I would like to declare a variable named site_config of type
any
and set the contents of the dynamic block to equal my variable.Instead of
I would like to do something like
If this isn't currently possible I think this would be a great enhancement. But if it is possible please share some sample code.
Thanks!
The text was updated successfully, but these errors were encountered: