Interview Prep/Terraform/Import Refactoring Drift and Lifecycle

AWS adds its own tags to resources, producing constant tag diffs. What do you do?

IntermediateScenarioImport Refactoring Drift and Lifecycle
Answer

Situation read → Tags starting with aws: or added by services (for example aws:cloudformation:*) differ from your config.

What I'd do →

  1. Check the plan for which keys differ.
  2. Use provider ignore_tags with key prefixes for system tags.
  3. Or lifecycle { ignore_changes = [tags["Owner"]] } for a specific key.

Why → You exclude tags you don't own while still managing yours.

Interview tip → Avoid blanket ignore_changes = [tags]; it stops managing your own tags too.

All Terraform questions Roadmap: Terraform in production

More on Import Refactoring Drift and Lifecycle