From cd4cb3f8d217a0f30ca4b69ff7ea597532c8cb09 Mon Sep 17 00:00:00 2001 From: James Bardin Date: Fri, 11 Dec 2020 13:40:10 -0500 Subject: [PATCH] add implied data depends_on caveat --- website/docs/configuration/data-sources.html.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/website/docs/configuration/data-sources.html.md b/website/docs/configuration/data-sources.html.md index 7d8597b27..33c1d679e 100644 --- a/website/docs/configuration/data-sources.html.md +++ b/website/docs/configuration/data-sources.html.md @@ -118,6 +118,12 @@ Data resources have the same dependency resolution behavior Setting the `depends_on` meta-argument within `data` blocks defers reading of the data source until after all changes to the dependencies have been applied. +In order to ensure that data sources are accessing the most up to date +information possible in a wide variety of use cases, arguments directly +referencing managed resources are treated the same as if the resource was +listed in `depends_on`. This behavior can be avoided when desired by indirectly +referencing the managed resource values through a `local` value. + ~> **NOTE:** **In Terraform 0.12 and earlier**, due to the data resource behavior of deferring the read until the apply phase when depending on values that are not yet known, using `depends_on` with `data` resources will force the read to always be deferred to the apply phase, and therefore a configuration that uses `depends_on` with a `data` resource can never converge. Due to this behavior, we do not recommend using `depends_on` with data resources.