mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-26 17:01:04 -06:00
87a375d49c
Make this node consistent with the naming if the other instances.
41 lines
995 B
Go
41 lines
995 B
Go
package terraform
|
|
|
|
import (
|
|
"github.com/hashicorp/terraform/providers"
|
|
"github.com/hashicorp/terraform/states"
|
|
)
|
|
|
|
// NodeDestroyableDataResourceInstance represents a resource that is "destroyable":
|
|
// it is ready to be destroyed.
|
|
type NodeDestroyableDataResourceInstance struct {
|
|
*NodeAbstractResourceInstance
|
|
}
|
|
|
|
// GraphNodeEvalable
|
|
func (n *NodeDestroyableDataResourceInstance) EvalTree() EvalNode {
|
|
addr := n.ResourceInstanceAddr()
|
|
|
|
var providerSchema *ProviderSchema
|
|
// We don't need the provider, but we're calling EvalGetProvider to load the
|
|
// schema.
|
|
var provider providers.Interface
|
|
|
|
// Just destroy it.
|
|
var state *states.ResourceInstanceObject
|
|
return &EvalSequence{
|
|
Nodes: []EvalNode{
|
|
&EvalGetProvider{
|
|
Addr: n.ResolvedProvider,
|
|
Output: &provider,
|
|
Schema: &providerSchema,
|
|
},
|
|
&EvalWriteState{
|
|
Addr: addr.Resource,
|
|
State: &state,
|
|
ProviderAddr: n.ResolvedProvider,
|
|
ProviderSchema: &providerSchema,
|
|
},
|
|
},
|
|
}
|
|
}
|