Interview Prep/Terraform/Lifecycle, Dependencies, Provisioners and Drift

What is the difference between implicit and explicit dependencies?

BeginnerConceptLifecycle, Dependencies, Provisioners and Drift
Answer

Implicit: Terraform infers order from references (subnet_id = aws_subnet.a.id). Explicit: you add depends_on = [aws_iam_role_policy.x] for dependencies the graph cannot see, such as an IAM policy that must exist before an instance starts. Prefer implicit references; use depends_on sparingly and comment why.

All Terraform questions Roadmap: Terraform in production

More on Lifecycle, Dependencies, Provisioners and Drift