mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-30 10:47:14 -06:00
fc4ac52014
Variables weren't being interpolated during the Input phase, causing a syntax error on the interpolation string. Adding `walkInput` to the EvalTree operations prevents skipping the interpolation step.
25 lines
501 B
Go
25 lines
501 B
Go
package terraform
|
|
|
|
import "github.com/hashicorp/terraform/config"
|
|
|
|
// EvalInterpolate is an EvalNode implementation that takes a raw
|
|
// configuration and interpolates it.
|
|
type EvalInterpolate struct {
|
|
Config *config.RawConfig
|
|
Resource *Resource
|
|
Output **ResourceConfig
|
|
}
|
|
|
|
func (n *EvalInterpolate) Eval(ctx EvalContext) (interface{}, error) {
|
|
rc, err := ctx.Interpolate(n.Config, n.Resource)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
if n.Output != nil {
|
|
*n.Output = rc
|
|
}
|
|
|
|
return nil, nil
|
|
}
|