From 2b8fd18fa8b0ca8f2dc44e16a57d8d4420df32c7 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 10 Feb 2015 14:12:49 -0800 Subject: [PATCH] terraform: stateId for resource --- terraform/transform_resource.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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) +}