terraform: Enable DestroyEdgeTransformer
This commit is contained in:
parent
08dade5475
commit
311d27108e
|
@ -54,15 +54,18 @@ func (b *ApplyGraphBuilder) Steps() []GraphTransformer {
|
|||
State: b.State,
|
||||
},
|
||||
|
||||
// Attach the configuration to any resources
|
||||
&AttachResourceConfigTransformer{Module: b.Module},
|
||||
|
||||
// Create orphan output nodes
|
||||
&OrphanOutputTransformer{Module: b.Module, State: b.State},
|
||||
|
||||
// Attach the configuration to any resources
|
||||
&AttachResourceConfigTransformer{Module: b.Module},
|
||||
|
||||
// Attach the state
|
||||
&AttachStateTransformer{State: b.State},
|
||||
|
||||
// Destruction ordering
|
||||
&DestroyEdgeTransformer{Module: b.Module, State: b.State},
|
||||
|
||||
// Create all the providers
|
||||
&MissingProviderTransformer{Providers: b.Providers, Factory: providerFactory},
|
||||
&ProviderTransformer{},
|
||||
|
|
|
@ -34,23 +34,27 @@ func (n *NodeApplyableResource) ReferenceableName() []string {
|
|||
|
||||
// GraphNodeReferencer
|
||||
func (n *NodeApplyableResource) References() []string {
|
||||
// Let's make this a little shorter so it is easier to reference
|
||||
c := n.Config
|
||||
if c == nil {
|
||||
return nil
|
||||
// If we have a config, that is our source of truth
|
||||
if c := n.Config; c != nil {
|
||||
// Grab all the references
|
||||
var result []string
|
||||
result = append(result, c.DependsOn...)
|
||||
result = append(result, ReferencesFromConfig(c.RawCount)...)
|
||||
result = append(result, ReferencesFromConfig(c.RawConfig)...)
|
||||
for _, p := range c.Provisioners {
|
||||
result = append(result, ReferencesFromConfig(p.ConnInfo)...)
|
||||
result = append(result, ReferencesFromConfig(p.RawConfig)...)
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
// Grab all the references
|
||||
var result []string
|
||||
result = append(result, c.DependsOn...)
|
||||
result = append(result, ReferencesFromConfig(c.RawCount)...)
|
||||
result = append(result, ReferencesFromConfig(c.RawConfig)...)
|
||||
for _, p := range c.Provisioners {
|
||||
result = append(result, ReferencesFromConfig(p.ConnInfo)...)
|
||||
result = append(result, ReferencesFromConfig(p.RawConfig)...)
|
||||
// If we have state, that is our next source
|
||||
if s := n.ResourceState; s != nil {
|
||||
return s.Dependencies
|
||||
}
|
||||
|
||||
return result
|
||||
return nil
|
||||
}
|
||||
|
||||
// GraphNodeProviderConsumer
|
||||
|
|
|
@ -30,6 +30,11 @@ func (n *NodeDestroyResource) ProvidedBy() []string {
|
|||
return []string{resourceProvider(n.Addr.Type, "")}
|
||||
}
|
||||
|
||||
// GraphNodeDestroyer
|
||||
func (n *NodeDestroyResource) DestroyAddr() *ResourceAddress {
|
||||
return n.Addr
|
||||
}
|
||||
|
||||
// GraphNodeAttachResourceState
|
||||
func (n *NodeDestroyResource) ResourceAddr() *ResourceAddress {
|
||||
return n.Addr
|
||||
|
|
Loading…
Reference in New Issue