terraform: make sure all interpolation variables pass through hil

This commit is contained in:
Mitchell Hashimoto 2016-11-10 20:23:28 -08:00
parent cca3ed6c1a
commit 89919b605b
No known key found for this signature in database
GPG Key ID: 744E147AA52F5B0A
1 changed files with 4 additions and 2 deletions

View File

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