github.com/ojiry/terraform@v0.8.2-0.20161218223921-e50cec712c4a/terraform/node_provider_disabled.go (about)

     1  package terraform
     2  
     3  import (
     4  	"fmt"
     5  )
     6  
     7  // NodeDisabledProvider represents a provider that is disabled. A disabled
     8  // provider does nothing. It exists to properly set inheritance information
     9  // for child providers.
    10  type NodeDisabledProvider struct {
    11  	*NodeAbstractProvider
    12  }
    13  
    14  func (n *NodeDisabledProvider) Name() string {
    15  	return fmt.Sprintf("%s (disabled)", n.NodeAbstractProvider.Name())
    16  }
    17  
    18  // GraphNodeEvalable
    19  func (n *NodeDisabledProvider) EvalTree() EvalNode {
    20  	var resourceConfig *ResourceConfig
    21  	return &EvalSequence{
    22  		Nodes: []EvalNode{
    23  			&EvalInterpolate{
    24  				Config: n.ProviderConfig(),
    25  				Output: &resourceConfig,
    26  			},
    27  			&EvalBuildProviderConfig{
    28  				Provider: n.ProviderName(),
    29  				Config:   &resourceConfig,
    30  				Output:   &resourceConfig,
    31  			},
    32  			&EvalSetProviderConfig{
    33  				Provider: n.ProviderName(),
    34  				Config:   &resourceConfig,
    35  			},
    36  		},
    37  	}
    38  }