11. Meta-Arguments
depends_on
If two resources depend on each other (but not on each others data), depends_on specifies that dependency to enforce ordering
count
allows for creation of multiple resources/modules from a single block
usefil when multiple necessary resources are nearly identical
example is 4 ec2 instances with tag name as
${count.index}
for_each
allows for creation of multiple resources/modules from single block
allows more control to customize each resource than count
lifecycle
set of meta atguments to control terraform behaviour for specific resources
create_before_destroy
can help with zero downtime deploymentsignore_changes
prevents terraform from trying to revert metadata being set elsewhereprevent_destroy
causes terraform to reject any plan which would destroy the resource
Last updated