...

/

Configure Resource Using a dynamic Block

Configure Resource Using a dynamic Block

Learn how to configure a resource using a dynamic block.

In the previous lesson, we saw an example of a virtual network with a single subnet defined as a nested block.

Press + to interact
subnet {
name = "subnet1"
address_prefix = cidrsubnet(var.address_space[0],8,1)
}

The dynamic block

A virtual network will typically involve more than one subnet. We could define a separate nested block for each subnet, but that’s not a scalable or dynamic approach. It makes more sense to dynamically generate the nested blocks based on t ...

...