diff --git a/terraform/transform_resource.go b/terraform/transform_resource.go index 1178cab6d..9d1d6708d 100644 --- a/terraform/transform_resource.go +++ b/terraform/transform_resource.go @@ -61,7 +61,7 @@ func (n *graphNodeExpandedResource) Name() string { func (n *graphNodeExpandedResource) DependableName() []string { return []string{ n.Resource.Id(), - fmt.Sprintf("%s.%d", n.Resource.Id(), n.Index), + n.stateId(), } } @@ -98,3 +98,8 @@ func (n *graphNodeExpandedResource) EvalTree() EvalNode { return seq } + +// stateId is the name used for the state key +func (n *graphNodeExpandedResource) stateId() string { + return fmt.Sprintf("%s.%d", n.Resource.Id(), n.Index) +}