|
|
|
|
@ -277,15 +277,43 @@ func (n *NodeDestroyResourceInstance) EvalTree() EvalNode {
|
|
|
|
|
// leaving skeleton resource objects in state after their instances have
|
|
|
|
|
// all been destroyed.
|
|
|
|
|
type NodeDestroyResource struct {
|
|
|
|
|
NodeAbstractResource *NodeAbstractResource
|
|
|
|
|
*NodeAbstractResource
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var (
|
|
|
|
|
_ GraphNodeEvalable = (*NodeDestroyResource)(nil)
|
|
|
|
|
_ GraphNodeResource = (*NodeDestroyResource)(nil)
|
|
|
|
|
_ GraphNodeReferenceable = (*NodeDestroyResource)(nil)
|
|
|
|
|
_ GraphNodeReferencer = (*NodeDestroyResource)(nil)
|
|
|
|
|
_ GraphNodeEvalable = (*NodeDestroyResource)(nil)
|
|
|
|
|
|
|
|
|
|
// FIXME: this is here to document that this node is both
|
|
|
|
|
// GraphNodeProviderConsumer by virtue of the embedded
|
|
|
|
|
// NodeAbstractResource, but that behavior is not desired and we skip it by
|
|
|
|
|
// checking for GraphNodeNoProvider.
|
|
|
|
|
_ GraphNodeProviderConsumer = (*NodeDestroyResource)(nil)
|
|
|
|
|
_ GraphNodeNoProvider = (*NodeDestroyResource)(nil)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func (n *NodeDestroyResource) Name() string {
|
|
|
|
|
return n.NodeAbstractResource.ResourceAddr().String() + " (clean up state)"
|
|
|
|
|
return n.ResourceAddr().String() + " (clean up state)"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GraphNodeReferenceable, overriding NodeAbstractResource
|
|
|
|
|
func (n *NodeDestroyResource) ReferenceableAddrs() []addrs.Referenceable {
|
|
|
|
|
// NodeDestroyResource doesn't participate in references: the graph
|
|
|
|
|
// builder that created it should ensure directly that it already depends
|
|
|
|
|
// on every other node related to its resource, without relying on
|
|
|
|
|
// references.
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GraphNodeReferencer, overriding NodeAbstractResource
|
|
|
|
|
func (n *NodeDestroyResource) References() []*addrs.Reference {
|
|
|
|
|
// NodeDestroyResource doesn't participate in references: the graph
|
|
|
|
|
// builder that created it should ensure directly that it already depends
|
|
|
|
|
// on every other node related to its resource, without relying on
|
|
|
|
|
// references.
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GraphNodeEvalable
|
|
|
|
|
@ -295,6 +323,26 @@ func (n *NodeDestroyResource) EvalTree() EvalNode {
|
|
|
|
|
// leftover husk of a resource in state after all of the child instances
|
|
|
|
|
// and their objects were destroyed.
|
|
|
|
|
return &EvalForgetResourceState{
|
|
|
|
|
Addr: n.NodeAbstractResource.ResourceAddr().Resource,
|
|
|
|
|
Addr: n.ResourceAddr().Resource,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GraphNodeResource
|
|
|
|
|
func (n *NodeDestroyResource) ResourceAddr() addrs.AbsResource {
|
|
|
|
|
return n.NodeAbstractResource.ResourceAddr()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GraphNodeSubpath
|
|
|
|
|
func (n *NodeDestroyResource) Path() addrs.ModuleInstance {
|
|
|
|
|
return n.NodeAbstractResource.Path()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GraphNodeNoProvider
|
|
|
|
|
// FIXME: this should be removed once the node can be separated from the
|
|
|
|
|
// Internal NodeAbstractResource behavior.
|
|
|
|
|
func (n *NodeDestroyResource) NoProvider() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type GraphNodeNoProvider interface {
|
|
|
|
|
NoProvider()
|
|
|
|
|
}
|
|
|
|
|
|