Documentation ¶
Index ¶
- Constants
- type Executor
- type TerraformBackendConfig
- type TerraformFlags
- type TerraformOptions
- type TerraformRunner
- func (cmd *TerraformRunner) GenerateArguments() ([]string, error)
- func (cmd *TerraformRunner) GenerateBackendConfig() []string
- func (cmd *TerraformRunner) GenerateFlags() []string
- func (cmd *TerraformRunner) GenerateInputs() []string
- func (cmd *TerraformRunner) GenerateOptions() []string
- func (cmd *TerraformRunner) GetModule() error
- func (cmd *TerraformRunner) Output() (*map[string]interface{}, error)
- func (cmd *TerraformRunner) Resource(name string) (interface{}, error)
- func (cmd *TerraformRunner) Resources() ([]string, error)
- func (cmd *TerraformRunner) Run() error
- func (cmd *TerraformRunner) State() (*map[string]interface{}, error)
- func (cmd *TerraformRunner) Taint(name string) error
- func (cmd *TerraformRunner) UnTaint(name string) error
Constants ¶
const ( TerraformBin = "terraform" // FlagAutoApprove Terraform Flags FlagAutoApprove = "-auto-approve" FlagForceCopy = "-force-copy" FlagJSON = "-json" // OptionBackendConfig Terraform Options OptionBackendConfig = "-backend-config" OptionVar = "-var" OptionFromModule = "-from-module" // OperationInit Terraform actions OperationInit = "init" OperationApply = "apply" OperationPlan = "plan" OperationDestroy = "destroy" OperationState = "state" OperationTaint = "taint" OperationUntaint = "untaint" OperationShow = "show" OperationOutput = "output" ArgumentList = "list" ArgumentShow = "show" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TerraformBackendConfig ¶
type TerraformBackendConfig struct { }
TerraformBackendConfig is a collection of supported terraform init backend options
type TerraformFlags ¶
type TerraformFlags struct {
FlagForceCopy bool
}
TerraformFlags is a collection of supported terraform flags
type TerraformOptions ¶
type TerraformOptions struct {
FromModule bool
}
TerraformOptions is a collection of supported terraform options
type TerraformRunner ¶
type TerraformRunner struct { Module string Version string Directory string Operation string Inputs map[string]interface{} BackendConfig *TerraformBackendConfig Options *TerraformOptions Flags *TerraformFlags Writer io.Writer Executor Executor PrintOutput bool Debug bool }
TerraformRunner object is the main object which defines the `terraform` command and how to execute it.
func (*TerraformRunner) GenerateArguments ¶
func (cmd *TerraformRunner) GenerateArguments() ([]string, error)
GenerateArguments method generate the terraform arguments
func (*TerraformRunner) GenerateBackendConfig ¶
func (cmd *TerraformRunner) GenerateBackendConfig() []string
GenerateBackendConfig method generate the terraform arguments for `terraform init`
func (*TerraformRunner) GenerateFlags ¶
func (cmd *TerraformRunner) GenerateFlags() []string
GenerateFlags method generate the terraform flags
func (*TerraformRunner) GenerateInputs ¶
func (cmd *TerraformRunner) GenerateInputs() []string
GenerateInputs method generate the terraform `-var` arguments for `terraform apply, plan, destroy`
func (*TerraformRunner) GenerateOptions ¶
func (cmd *TerraformRunner) GenerateOptions() []string
GenerateOptions method generate the terraform options
func (*TerraformRunner) GetModule ¶
func (cmd *TerraformRunner) GetModule() error
GetModule clones the given repo into a directory
func (*TerraformRunner) Output ¶
func (cmd *TerraformRunner) Output() (*map[string]interface{}, error)
Output returns the output variables of a terraform module by running `terraform output -json`
func (*TerraformRunner) Resource ¶
func (cmd *TerraformRunner) Resource(name string) (interface{}, error)
func (*TerraformRunner) Resources ¶
func (cmd *TerraformRunner) Resources() ([]string, error)
func (*TerraformRunner) Run ¶
func (cmd *TerraformRunner) Run() error
Run method runs the terraform which used externally
func (*TerraformRunner) State ¶
func (cmd *TerraformRunner) State() (*map[string]interface{}, error)
State returns the state of the module by running `terraform show -json`
func (*TerraformRunner) Taint ¶
func (cmd *TerraformRunner) Taint(name string) error
func (*TerraformRunner) UnTaint ¶
func (cmd *TerraformRunner) UnTaint(name string) error