terraform: output the exact instance for prevent destroy on count

This commit is contained in:
Mitchell Hashimoto 2016-11-07 14:05:21 -08:00
parent e6be4fefe8
commit a2d71388c2
No known key found for this signature in database
GPG Key ID: 744E147AA52F5B0A
2 changed files with 6 additions and 2 deletions

View File

@ -52,6 +52,9 @@ func (n *NodePlannableResource) DynamicExpand(ctx EvalContext) (*Graph, error) {
// The concrete resource factory we'll use for oprhans // The concrete resource factory we'll use for oprhans
concreteResourceOrphan := func(a *NodeAbstractResource) dag.Vertex { concreteResourceOrphan := func(a *NodeAbstractResource) dag.Vertex {
// Add the config and state since we don't do that via transforms
a.Config = n.Config
return &NodePlannableResourceOrphan{ return &NodePlannableResourceOrphan{
NodeAbstractResource: a, NodeAbstractResource: a,
} }

View File

@ -47,8 +47,9 @@ func (n *NodePlannableResourceOrphan) EvalTree() EvalNode {
Output: &diff, Output: &diff,
}, },
&EvalCheckPreventDestroy{ &EvalCheckPreventDestroy{
Resource: n.Config, Resource: n.Config,
Diff: &diff, ResourceId: stateId,
Diff: &diff,
}, },
&EvalWriteDiff{ &EvalWriteDiff{
Name: stateId, Name: stateId,