terraform: make sure all interpolation variables pass through hil
This commit is contained in:
parent
cca3ed6c1a
commit
89919b605b
|
@ -436,13 +436,15 @@ func (i *Interpolater) computeResourceVariable(
|
||||||
// Lists and sets make this
|
// Lists and sets make this
|
||||||
key := fmt.Sprintf("%s.#", strings.Join(parts[:i], "."))
|
key := fmt.Sprintf("%s.#", strings.Join(parts[:i], "."))
|
||||||
if attr, ok := r.Primary.Attributes[key]; ok {
|
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
|
// Maps make this
|
||||||
key = fmt.Sprintf("%s", strings.Join(parts[:i], "."))
|
key = fmt.Sprintf("%s", strings.Join(parts[:i], "."))
|
||||||
if attr, ok := r.Primary.Attributes[key]; ok {
|
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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue