]> git.immae.eu Git - github/fretlink/terraform-provider-statuscake.git/blob - vendor/github.com/hashicorp/terraform/terraform/node_provisioner.go
Upgrade to 0.12
[github/fretlink/terraform-provider-statuscake.git] / vendor / github.com / hashicorp / terraform / terraform / node_provisioner.go
1 package terraform
2
3 import (
4 "fmt"
5
6 "github.com/hashicorp/terraform/addrs"
7 "github.com/hashicorp/terraform/config"
8 )
9
10 // NodeProvisioner represents a provider that has no associated operations.
11 // It registers all the common interfaces across operations for providers.
12 type NodeProvisioner struct {
13 NameValue string
14 PathValue addrs.ModuleInstance
15
16 // The fields below will be automatically set using the Attach
17 // interfaces if you're running those transforms, but also be explicitly
18 // set if you already have that information.
19
20 Config *config.ProviderConfig
21 }
22
23 var (
24 _ GraphNodeSubPath = (*NodeProvisioner)(nil)
25 _ GraphNodeProvisioner = (*NodeProvisioner)(nil)
26 _ GraphNodeEvalable = (*NodeProvisioner)(nil)
27 )
28
29 func (n *NodeProvisioner) Name() string {
30 result := fmt.Sprintf("provisioner.%s", n.NameValue)
31 if len(n.PathValue) > 0 {
32 result = fmt.Sprintf("%s.%s", n.PathValue.String(), result)
33 }
34
35 return result
36 }
37
38 // GraphNodeSubPath
39 func (n *NodeProvisioner) Path() addrs.ModuleInstance {
40 return n.PathValue
41 }
42
43 // GraphNodeProvisioner
44 func (n *NodeProvisioner) ProvisionerName() string {
45 return n.NameValue
46 }
47
48 // GraphNodeEvalable impl.
49 func (n *NodeProvisioner) EvalTree() EvalNode {
50 return &EvalInitProvisioner{Name: n.NameValue}
51 }