diff --git a/terraform/eval_diff.go b/terraform/eval_diff.go index d299e76c0..891e7a3d6 100644 --- a/terraform/eval_diff.go +++ b/terraform/eval_diff.go @@ -424,9 +424,10 @@ func groupContainers(d *InstanceDiff) map[string]flatAttrDiff { // EvalDiffDestroy is an EvalNode implementation that returns a plain // destroy diff. type EvalDiffDestroy struct { - Addr addrs.ResourceInstance - State **InstanceState - Output **InstanceDiff + Addr addrs.ResourceInstance + State **InstanceState + Output **InstanceDiff + OutputState **InstanceState } // TODO: test @@ -463,9 +464,9 @@ func (n *EvalDiffDestroy) Eval(ctx EvalContext) (interface{}, error) { // Update our output *n.Output = diff - if n.State != nil { + if n.OutputState != nil { // Record our proposed new state, which is nil because we're destroying. - *n.State = nil + *n.OutputState = nil } return nil, nil diff --git a/terraform/node_resource_plan_orphan.go b/terraform/node_resource_plan_orphan.go index 52685ad55..09aec8c82 100644 --- a/terraform/node_resource_plan_orphan.go +++ b/terraform/node_resource_plan_orphan.go @@ -45,9 +45,10 @@ func (n *NodePlannableResourceInstanceOrphan) EvalTree() EvalNode { Output: &state, }, &EvalDiffDestroy{ - Addr: addr.Resource, - State: &state, // Will point to a nil state after this complete, signalling destroyed - Output: &diff, + Addr: addr.Resource, + State: &state, + Output: &diff, + OutputState: &state, // Will point to a nil state after this complete, signalling destroyed }, &EvalCheckPreventDestroy{ Addr: addr.Resource,