From 89919b605bcdcdb40e94bedefbbd715e44ba8383 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 10 Nov 2016 20:23:28 -0800 Subject: [PATCH] terraform: make sure all interpolation variables pass through hil --- terraform/interpolate.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/terraform/interpolate.go b/terraform/interpolate.go index 3fb0b66a7..b9538fa2d 100644 --- a/terraform/interpolate.go +++ b/terraform/interpolate.go @@ -436,13 +436,15 @@ func (i *Interpolater) computeResourceVariable( // Lists and sets make this key := fmt.Sprintf("%s.#", strings.Join(parts[:i], ".")) if attr, ok := r.Primary.Attributes[key]; ok { - return &ast.Variable{Type: ast.TypeString, Value: attr}, nil + v, err := hil.InterfaceToVariable(attr) + return &v, err } // Maps make this key = fmt.Sprintf("%s", strings.Join(parts[:i], ".")) if attr, ok := r.Primary.Attributes[key]; ok { - return &ast.Variable{Type: ast.TypeString, Value: attr}, nil + v, err := hil.InterfaceToVariable(attr) + return &v, err } } }