Documentation
¶
Index ¶
- Constants
- func AddOutput(infrastructure *Infrastructure, outputName string, output *Output)
- func AddResource(infrastructure *Infrastructure, resourceType, resourceName string, ...)
- func GetConnInfoFromEndpointCredentials(kv *api.KV, deploymentID, nodeName string) (string, string, error)
- type Connection
- type ConsulKey
- type ConsulKeys
- type Generator
- type Infrastructure
- type Output
- type PreDestroyInfraCallback
- type RemoteExec
- type Resource
Constants ¶
const ( // DefaultSSHPrivateKeyFilePath is the default SSH private Key file path // used to connect to provisioned resources DefaultSSHPrivateKeyFilePath = "~/.ssh/yorc.pem" )
Variables ¶
This section is empty.
Functions ¶
func AddOutput ¶
func AddOutput(infrastructure *Infrastructure, outputName string, output *Output)
AddOutput allows to add an Output to a defined Infrastructure
func AddResource ¶
func AddResource(infrastructure *Infrastructure, resourceType, resourceName string, resource interface{})
AddResource allows to add a Resource to a defined Infrastructure
Types ¶
type Connection ¶
type Connection struct { ConnType string `json:"type,omitempty"` User string `json:"user,omitempty"` Password string `json:"password,omitempty"` Host string `json:"host,omitempty"` Port string `json:"port,omitempty"` Timeout string `json:"timeout,omitempty"` // defaults to "5m" PrivateKey string `json:"private_key,omitempty"` }
A Connection allows to overwrite the way Terraform connects to a resource
type ConsulKey ¶
type ConsulKey struct { Path string `json:"path"` // Should only be use in datasource (read) mode, this is the name to use to access this key within the terraform interpolation syntax Name string `json:"name,omitempty"` Default string `json:"default,omitempty"` Value string `json:"value,omitempty"` // Should only be use in resource (write) mode, deletes the key Delete bool `json:"delete,omitempty"` }
A ConsulKey can be used in a ConsulKeys 'resource' to writes or a ConsulKeys 'data' to read an individual Key/Value pair into Consul
type ConsulKeys ¶
type ConsulKeys struct { Resource Datacenter string `json:"datacenter,omitempty"` Token string `json:"token,omitempty"` Keys []ConsulKey `json:"key"` }
The ConsulKeys can be used as 'resource' to writes or 'data' to read sets of individual values into Consul.
type Generator ¶
type Generator interface { // GenerateTerraformInfraForNode generates the Terraform infrastructure file for the given node. // It returns 'true' if a file was generated and 'false' otherwise (in case of a infrastructure component // already exists for this node and should just be reused). // GenerateTerraformInfraForNode can also return a map of outputs names indexed by consul keys into which the outputs results should be stored. // And a list of environment variables in form "key=value" to be added to the current process environment when running terraform commands. // This is particularly useful for adding secrets that should not be in tf files. GenerateTerraformInfraForNode(ctx context.Context, cfg config.Configuration, deploymentID, nodeName, infrastructurePath string) (bool, map[string]string, []string, error) }
A Generator is used to generate the Terraform infrastructure for a given TOSCA node
type Infrastructure ¶
type Infrastructure struct { Terraform map[string]interface{} `json:"terraform,omitempty"` Data map[string]interface{} `json:"data,omitempty"` Variable map[string]interface{} `json:"variable,omitempty"` Provider map[string]interface{} `json:"provider,omitempty"` Resource map[string]interface{} `json:"resource,omitempty"` Output map[string]*Output `json:"output,omitempty"` }
An Infrastructure is the top-level element of a Terraform infrastructure definition
type Output ¶
type Output struct { // Value is the value of the output. This can be a string, list, or map. // This usually includes an interpolation since outputs that are static aren't usually useful. Value interface{} `json:"value"` Sensitive bool `json:"sensitive,omitempty"` }
An Output allows to define a terraform output value
type PreDestroyInfraCallback ¶
type PreDestroyInfraCallback func(ctx context.Context, kv *api.KV, cfg config.Configuration, deploymentID, nodeName, infrastructurePath string) (bool, error)
PreDestroyInfraCallback is a function that is call before destroying an infrastructure. If it returns false the node will not be destroyed.
type RemoteExec ¶
type RemoteExec struct { Connection *Connection `json:"connection,omitempty"` Inline []string `json:"inline,omitempty"` Script string `json:"script,omitempty"` Scripts []string `json:"scripts,omitempty"` }
The RemoteExec provisioner invokes a script on a remote resource after it is created.
The remote-exec provisioner supports both ssh and winrm type connections.