Loading...
Loading...
### Terraform Version ```shell Terraform v1.14.8 on linux_amd64 ``` ### Terraform Configuration Files ```terraform # main.tf module "some" { source = "./some" } resource "random_string" "this" { length = 4 depends_on = [ module.some.doesnotexist ] } ``` ```terraform # some/main.tf resource "random_string" "dummy" { length = 3 } ``` ### Debug Output not needed ### Expected Behavior terraform should warn/error because module.some has no output `doesnotexist` ### Actual Behavior terraform silently and implicitly adds a dependency to the whole module (that is, all its resources and outputs) as if the code would read `depends_on = [ module.some ]`: ### Steps to Reproduce 1. terraform init 2. terraform graph ```dot digraph G { rankdir = "RL"; node [shape = rect, fontname = "sans-serif"]; "random_string.this" [label="random_string.this"]; subgraph "cluster_module.some" { label = "module.some" fontname = "sans-serif" "module.some.random_string.dummy" [label="random_string.dummy"]; } "random_string.this" -> "module.some.random_string.dummy"; // random_string.this should not depend on some.dummy } ``` (comment added for clarity) ### Additional Context Thanks to @kaiehrhardt for finding that bug ### References The `terraform output` CLI seems to have the same problem: - #22127 ### Generative AI / LLM assisted development? none
Click on a version to see all relevant bugs
Terraform Integration
Learn more about where this data comes from
Bug Scrub Advisor
Streamline upgrades with automated vendor bug scrubs
BugZero Enterprise
Wish you caught this bug sooner? Get proactive today.