Terraform Identity: Control vs. Discovery

Stop treating variables and data sources as interchangeable. They represent two different ways of handling the dependency graph:

  • Variables = Control. They are root input nodes. You are declaring a contract where the caller is responsible for the resource’s existence.
  • Data Sources = Observation. They are provider-backed lookups. You are discovering reality through attributes like tags, forcing Terraform to validate existence during the plan phase.

Watch the breakdown: https://youtu.be/vSG7BzoAM4o