terraform

package
v0.0.0-...-21311fb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 29, 2023 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(stateDir string, config Config) (*terraform, error)

func NewFromState

func NewFromState(config Config, stateConfig infra.ProvisionerState) (*terraform, error)

Types

type Config

type Config struct {
	// Config specifies common infrastructure configuration
	infra.Config
	// CloudProvider defines cloud to deploy to
	CloudProvider string `validate:"required,eq=aws|eq=azure|eq=gce"`
	// AWS defines AWS connection parameters
	AWS *aws.Config
	// Azure defines Azure connection parameters
	Azure *azure.Config
	// GCE defines Google Compute Engine connection parameters
	GCE *gce.Config
	// OS specified the OS distribution
	OS string `json:"os" yaml:"os" validate:"required,eq=ubuntu|eq=redhat|eq=centos|eq=debian|eq=sles|eq=suse"`
	// ScriptPath is the path to the terraform script or directory for provisioning
	ScriptPath string `json:"script_path" validate:"required"`
	// NumNodes defines the capacity of the cluster to provision
	NumNodes int `json:"nodes" validate:"gte=1"`
	// InstallerURL is AWS S3 URL with the installer
	InstallerURL string `json:"installer_url" validate:"required,url"`
	// DockerDevice block device for docker data - set to /dev/xvdb
	DockerDevice string `json:"docker_device" yaml:"docker_device" validate:"required"`
	// PostInstallerScript defines a path to the script on a remote node
	// that is executed after the installer has been downloaded
	PostInstallerScript string `json:"post_installer_script" yaml:"post_installer_script"`
	// VarFilePath is the file path with custom terraform variables
	VarFilePath string `json:"var_file_path" yaml:"var_file_path"`
	// OnpremProvider specifies usage of onprem provider for installation
	OnpremProvider bool `json:"onprem_provider" yaml:"onprem_provider"`
	// PluginDir is the directory terraform plugins reside in
	PluginDir string `json:"plugin_dir,omitempty" yaml:"plugin_dir,omitempty"`
}

Config represents terraform provisioning configuration

func (Config) SSHConfig

func (c Config) SSHConfig() (user, keypath string)

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the configuration

type State

type State struct {
	// LoadBalancerAddr defines the DNS name of the load balancer
	LoadBalancerAddr string `json:"loadbalancer"`
}

State defines terraform-specific state

func (*State) MarshalJSON

func (r *State) MarshalJSON() ([]byte, error)

MarshalJSON serializes this state object as JSON

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL