7 "github.com/hashicorp/terraform/config"
10 // NodeApplyableOutput represents an output that is "applyable":
11 // it is ready to be applied.
12 type NodeApplyableOutput struct {
14 Config *config.Output // Config is the output in the config
17 func (n *NodeApplyableOutput) Name() string {
18 result := fmt.Sprintf("output.%s", n.Config.Name)
19 if len(n.PathValue) > 1 {
20 result = fmt.Sprintf("%s.%s", modulePrefixStr(n.PathValue), result)
27 func (n *NodeApplyableOutput) Path() []string {
31 // RemovableIfNotTargeted
32 func (n *NodeApplyableOutput) RemoveIfNotTargeted() bool {
33 // We need to add this so that this node will be removed if
34 // it isn't targeted or a dependency of a target.
38 // GraphNodeReferenceable
39 func (n *NodeApplyableOutput) ReferenceableName() []string {
40 name := fmt.Sprintf("output.%s", n.Config.Name)
44 // GraphNodeReferencer
45 func (n *NodeApplyableOutput) References() []string {
47 result = append(result, n.Config.DependsOn...)
48 result = append(result, ReferencesFromConfig(n.Config.RawConfig)...)
49 for _, v := range result {
50 split := strings.Split(v, "/")
51 for i, s := range split {
52 split[i] = s + ".destroy"
55 result = append(result, strings.Join(split, "/"))
62 func (n *NodeApplyableOutput) EvalTree() EvalNode {
64 Ops: []walkOperation{walkRefresh, walkPlan, walkApply,
65 walkDestroy, walkInput, walkValidate},
70 Sensitive: n.Config.Sensitive,
71 Value: n.Config.RawConfig,