terraform

package
v0.0.2-0...-06f6063 Latest Latest
Warning

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

Go to latest
Published: May 19, 2021 License: MIT, MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const Terraform = "terraform"

Variables

This section is empty.

Functions

func ApplyCommmand

func ApplyCommmand(arguments ApplyArguments) *exec.Cmd

ApplyCommmand builds a terraform apply command

func BuildArgs

func BuildArgs(x interface{}) []string

BuildArgs builds args

func CreateGoFiles

func CreateGoFiles(path string)

CreateGoFiles creates go files

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

func GetTerraformVersion() (string, error)

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 InstallTerraform

func InstallTerraform() error

InstallTerraform installs Terraform 0.13

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

func WhichTerraform() (string, error)

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

Jump to

Keyboard shortcuts

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