github.com/kanishk98/terraform@v1.3.0-dev.0.20220917174235-661ca8088a6a/internal/terraform/node_data_destroy.go (about) 1 package terraform 2 3 import ( 4 "log" 5 6 "github.com/hashicorp/terraform/internal/tfdiags" 7 ) 8 9 // NodeDestroyableDataResourceInstance represents a resource that is "destroyable": 10 // it is ready to be destroyed. 11 type NodeDestroyableDataResourceInstance struct { 12 *NodeAbstractResourceInstance 13 } 14 15 var ( 16 _ GraphNodeExecutable = (*NodeDestroyableDataResourceInstance)(nil) 17 ) 18 19 // GraphNodeExecutable 20 func (n *NodeDestroyableDataResourceInstance) Execute(ctx EvalContext, op walkOperation) tfdiags.Diagnostics { 21 log.Printf("[TRACE] NodeDestroyableDataResourceInstance: removing state object for %s", n.Addr) 22 ctx.State().SetResourceInstanceCurrent(n.Addr, nil, n.ResolvedProvider) 23 return nil 24 }