2015-02-03 03:43:18 -06:00
|
|
|
package terraform
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/hashicorp/terraform/config"
|
|
|
|
)
|
|
|
|
|
|
|
|
// EvalInterpolate is an EvalNode implementation that takes a raw
|
|
|
|
// configuration and interpolates it.
|
|
|
|
type EvalInterpolate struct {
|
2015-02-05 19:09:57 -06:00
|
|
|
Config *config.RawConfig
|
|
|
|
Resource *Resource
|
2015-02-03 03:43:18 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
func (n *EvalInterpolate) Args() ([]EvalNode, []EvalType) {
|
|
|
|
return nil, nil
|
|
|
|
}
|
|
|
|
|
2015-02-03 18:06:12 -06:00
|
|
|
func (n *EvalInterpolate) Eval(
|
|
|
|
ctx EvalContext, args []interface{}) (interface{}, error) {
|
2015-02-05 19:09:57 -06:00
|
|
|
return ctx.Interpolate(n.Config, n.Resource)
|
2015-02-03 03:43:18 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
func (n *EvalInterpolate) Type() EvalType {
|
|
|
|
return EvalTypeConfig
|
|
|
|
}
|