terraform: stateId for resource

This commit is contained in:
Mitchell Hashimoto 2015-02-10 14:12:49 -08:00
parent 98eb9a1f19
commit 2b8fd18fa8
1 changed files with 6 additions and 1 deletions

View File

@ -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)
}