What does `replace_triggered_by` do?
AdvancedConceptLifecycle, Dependencies, Provisioners and Drift
Answer
It forces replacement of a resource when another resource or attribute changes, even if the resource itself shows no diff.
lifecycle {
replace_triggered_by = [aws_launch_template.app.latest_version]
}
Useful when a dependency changes in a way the dependent does not notice (for instance a config object feeding a running instance).
More on Lifecycle, Dependencies, Provisioners and Drift
What are meta-arguments?BeginnerWhat lifecycle options are available?BeginnerHow does `create_before_destroy` work and what can go wrong?AdvancedWhat does `prevent_destroy` guarantee and what does it not?AdvancedWhen do you use `ignore_changes`?IntermediateHow do `precondition` and `postcondition` differ?Intermediate