TFNFR6 - Resource & Data Order
For the definition of resources in the same file, the resources be depended on SHOULD come first, after them are the resources depending on others.
For the definition of resources in the same file, the resources be depended on SHOULD come first, after them are the resources depending on others.
We can use count
and for_each
to deploy multiple resources, but the improper use of count
can lead to
anti pattern
.
You can use count
to create some kind of resources under certain conditions, for example:
There are 3 types of assignment statements in a resource
or data
block: argument, meta-argument and nested block. The argument assignment statement is a parameter followed by =
:
The meta-arguments below SHOULD be declared on the top of a module
block with the following order:
source
version
count
for_each
blank lines will be used to separate them.