website/docs/language/meta-arguments/lifecycle.mdx
lifecycle BlocksSeveral different declaration types in the OpenTofu language support a nested
block named lifecycle which includes settings that customize the plan and
apply behavior of the associated object.
Each different type of declaration relates to objects that have a different lifecycle, and so the arguments available in these blocks are distinct for each parent block type:
resource block lifecycle, for managed resources.data block lifecycle, for data resources.ephemeral block lifecycle, for ephemeral resources.module block lifecycle, for settings that relate to an overall module call instead of the individual resources inside it.Although all of these features involve a block type named lifecycle, the
expected arguments and associated behavior is defined separately for each
context where a block of that type is allowed to appear.