Terraform & IaC (50 Qs)•Part 1: Terraform Core Architecture, HCL & Providers (1 - 15)
Explicit Dependencies (`depends_on`) vs. Implicit Dependencies in the Resource Graph.
senior LevelFormsCI/CD & DevOpsSystem Design
In Simple Words:
- Implicit Dependency (Automatic): When you reference an attribute of one resource in another (e.g.
vpc_id = aws_vpc.main.id). Terraform automatically infers thataws_vpc.mainmust be created first. - Explicit Dependency (
depends_on): Used when two resources have a hidden dependency not expressed in HCL references (e.g. an S3 bucket notification policy depends on an IAM role having propagated). Overusingdepends_onlimits Terraform's ability to run operations in parallel.