According to the documentation for Arbitrary Expressions with Argument Syntax we should be able to specify blocks like this
# Not recommended, but valid: a constant list-of-objects expression
example = [
{
foo = "bar"
},
{
foo = "baz"
},
]
But this does not seem to work giving error for resource snowflake_warehouse
An argument named “tag” is not expected here. Did you mean to define a block of type “tag”?
resource "snowflake_warehouse" "foo" {
name = "foo"
tag = [
{
name = "foor"
value = "bar"
},
{
name = "env"
value = "dev"
},
]
}
Specifying as blocks works but I am unsure how to do so dynamically (using dynamic block doesn’t seem to work as it only specifies tag block once)
resource "snowflake_warehouse" "foo" {
name = "foo"
tag {
name = "foor"
value = "bar"
}
tag {
name = "env"
value = "dev"
}
}
Any help is appreciated