Terraform Lifecycle - jrott

Terraform Lifecycle

TIL I learned about terraform lifecycles and being able to ignore changes in parts of a resource. For example I’ll show this stolen example from the terraform docs for ignoring tags since that is what I was trying to do.

resource "aws_instance" "example" {
  # ...

  lifecycle {
    ignore_changes = [
      # Ignore changes to tags, e.g. because a management agent
      # updates these based on some ruleset managed elsewhere.
      tags,
    ]
  }
}