From 366f70a71eac02d4bd097b259ca8568155c9cab1 Mon Sep 17 00:00:00 2001 From: Paul Tyng Date: Tue, 30 Jul 2019 10:37:58 -0400 Subject: [PATCH] Update copy for Exists You can signal the same information in `Read` with an empty ID if the object does not exist, Implementing `Exists` is not the only way to do so and in some providers is also not the preferred way. --- helper/schema/resource.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/helper/schema/resource.go b/helper/schema/resource.go index bcfe5666f..c1bdf1170 100644 --- a/helper/schema/resource.go +++ b/helper/schema/resource.go @@ -95,9 +95,10 @@ type Resource struct { // // Exists is a function that is called to check if a resource still // exists. If this returns false, then this will affect the diff - // accordingly. If this function isn't set, it will not be called. It - // is highly recommended to set it. The *ResourceData passed to Exists - // should _not_ be modified. + // accordingly. If this function isn't set, it will not be called. You + // can also signal existence in the Read method by calling d.SetId("") + // if the Resource is not longer present and should be removed from state. + // The *ResourceData passed to Exists should _not_ be modified. Create CreateFunc Read ReadFunc Update UpdateFunc