When do you use `ignore_changes`?
IntermediateConceptLifecycle, Dependencies, Provisioners and Drift
Answer
When something else legitimately modifies an attribute, such as autoscaling changing desired_capacity, or an external system adding tags. List attributes explicitly.
lifecycle {
ignore_changes = [desired_capacity, tags["last_deployed"]]
}
ignore_changes = all freezes everything after creation and hides real drift, so we avoid it.
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?AdvancedWhat does `replace_triggered_by` do?AdvancedHow do `precondition` and `postcondition` differ?Intermediate