Documentation ¶
Index ¶
- Constants
- func ApplyCommmand(arguments ApplyArguments) *exec.Cmd
- func BuildArgs(x interface{}) []string
- func CreateGoFiles(path string)
- func CreateMainFile(cfg config.TrexConfig) ([]byte, error)
- func DestroyCommand(arguments ApplyArguments) *exec.Cmd
- func FmtCommand(arguments FmtArguments) *exec.Cmd
- func GetTerraformVersion() (string, error)
- func ImportCommand(arguments ImportArguments) *exec.Cmd
- func InitCommand(arguments InitArguments) *exec.Cmd
- func InstallTerraform() error
- func IsTerraformInstalled() bool
- func OutputCommand(arguments OutputArguments) *exec.Cmd
- func PlanCommand(arguments PlanArguments) *exec.Cmd
- func WhichTerraform() (string, error)
- type ApplyArguments
- type FmtArguments
- type ImportArguments
- type InitArguments
- type OutputArguments
- type PlanArguments
Constants ¶
const Terraform = "terraform"
Variables ¶
This section is empty.
Functions ¶
func ApplyCommmand ¶
func ApplyCommmand(arguments ApplyArguments) *exec.Cmd
ApplyCommmand builds a terraform apply command
func CreateMainFile ¶
func CreateMainFile(cfg config.TrexConfig) ([]byte, error)
CreateMainFile creates a terraform main.tf file from template
func DestroyCommand ¶
func DestroyCommand(arguments ApplyArguments) *exec.Cmd
DestroyCommand creates a terraform destroy command
func FmtCommand ¶
func FmtCommand(arguments FmtArguments) *exec.Cmd
FmtCommand creates an fmt command
func GetTerraformVersion ¶
GetTerraformVersion gets the version of terraform running
func ImportCommand ¶
func ImportCommand(arguments ImportArguments) *exec.Cmd
ImportCommand creates an import command
func InitCommand ¶
func InitCommand(arguments InitArguments) *exec.Cmd
InitCommand creates an init command
func IsTerraformInstalled ¶
func IsTerraformInstalled() bool
IsTerraformInstalled returns true if Terraform is installed
func OutputCommand ¶
func OutputCommand(arguments OutputArguments) *exec.Cmd
OutputCommand creates an output command
func PlanCommand ¶
func PlanCommand(arguments PlanArguments) *exec.Cmd
PlanCommand creates a plan command
func WhichTerraform ¶
WhichTerraform gets the path of the Terraform
Types ¶
type ApplyArguments ¶
type ApplyArguments struct { BackupPath *string `flag:"-backup-path"` Lock *bool `flag:"-lock"` LockTimeout *int `flag:"-lock-timeout"` Input *bool `flag:"-input"` AutoApprove *bool `flag:"-auto-approve"` NoColor *bool `flag:"-no-color"` Parallelism *int `flag:"-parallelism"` Refresh *bool `flag:"-refresh"` State *string `flag:"-state"` StateOut *string `flag:"-state-out"` Targets []string `flag:"-target"` Variables map[string]string `flag:"-var"` VariableFiles []string `flag:"-var-file"` DirOrPlan *string `pos:"0"` }
ApplyArguments is args for apply
type FmtArguments ¶
type FmtArguments struct { List *bool `flag:"list"` Write *bool `flag:"write"` Diff *bool `flag:"diff"` Check *bool `flag:"check"` Dir *string `pos:"0"` }
FmtArguments arguments for fmt
type ImportArguments ¶
type ImportArguments struct { Address string `pos:"0"` ID string `pos:"1"` Backup *string `flag:"-backup"` Config *string `flag:"-config"` Lock *bool `flag:"-lock"` LockTimeout *int `flag:"-lock-timeout"` Input *bool `flag:"-input"` NoColor *bool `flag:"-no-color"` Parallelism *int `flag:"-parallelism"` Provider *string `flag:"-provider"` State *string `flag:"-state"` StateOut *string `flag:"-state-out"` Variables map[string]string `flag:"-var"` VariableFiles []string `flag:"-var-file"` }
ImportArguments arguments for import command
type InitArguments ¶
type InitArguments struct { Dir *string `pos:"0"` Input *bool `flag:"-input"` Lock *bool `flag:"-lock"` LockTimeout *int `flag:"-lock-timeout"` NoColor *bool `flag:"-no-color"` Upgrade *string `flag:"-upgrade"` }
InitArguments arguments for init command
type OutputArguments ¶
type OutputArguments struct { Name *string `pos:"0"` JSON *bool `flag:"-json"` State *string `flag:"-state"` Module *string `flag:"-module"` }
OutputArguments arguments for output command
type PlanArguments ¶
type PlanArguments struct { Destroy *bool `flag:"-destroy"` DetailedExitCode *bool `flag:"-detailed-exitcode"` Input *bool `flag:"-input"` Lock *bool `flag:"-lock"` LockTimeout *int `flag:"-lock-timeout"` NoColor *bool `flag:"-no-color"` Out *string `flag:"-out"` Parrallism *int `flag:"-parallelism"` Refresh *bool `flag:"-refresh"` State *string `flag:"-state"` Targets []string `flag:"-target"` Variables []string `flag:"-var"` VariableFiles []string `flag:"-var-file"` Dir *string `pos:"0"` }
PlanArguments arguments for plan command