Documentation
¶
Index ¶
- func FindTerraform() (string, error)
- type AddrOption
- type AllowMissingConfigOption
- type ApplyOption
- type BackendConfigOption
- type BackendOption
- type BackupOption
- type ConfigOption
- type DestroyFlagOption
- type DestroyOption
- type DirOrPlanOption
- type Err
- type ErrCLIUsage
- type ErrNoConfig
- type ErrNoInit
- type ErrNoSuitableBinary
- type ErrVersionMismatch
- type ForceCopyOption
- type FromModuleOption
- type GetOption
- type GetPluginsOption
- type IdOption
- type ImportOption
- type InitOption
- type LockOption
- type LockTimeoutOption
- type OutOption
- type OutputMeta
- type OutputOption
- type ParallelismOption
- type PlanOption
- type PluginDirOption
- type ReconfigureOption
- type RefreshOption
- type StateOption
- type StateOutOption
- type TargetOption
- type Terraform
- func (tf *Terraform) Apply(ctx context.Context, opts ...ApplyOption) error
- func (tf *Terraform) ApplyCmd(ctx context.Context, opts ...ApplyOption) *exec.Cmd
- func (tf *Terraform) Destroy(ctx context.Context, opts ...DestroyOption) error
- func (tf *Terraform) DestroyCmd(ctx context.Context, opts ...DestroyOption) *exec.Cmd
- func (tf *Terraform) ImportCmd(ctx context.Context, opts ...ImportOption) *exec.Cmd
- func (t *Terraform) Init(ctx context.Context, opts ...InitOption) error
- func (tf *Terraform) InitCmd(ctx context.Context, opts ...InitOption) *exec.Cmd
- func (tf *Terraform) Output(ctx context.Context, opts ...OutputOption) (map[string]OutputMeta, error)
- func (tf *Terraform) OutputCmd(ctx context.Context, opts ...OutputOption) *exec.Cmd
- func (tf *Terraform) Plan(ctx context.Context, opts ...PlanOption) error
- func (tf *Terraform) PlanCmd(ctx context.Context, opts ...PlanOption) *exec.Cmd
- func (tf *Terraform) ProvidersSchema(ctx context.Context) (*tfjson.ProviderSchemas, error)
- func (tf *Terraform) ProvidersSchemaCmd(ctx context.Context, args ...string) *exec.Cmd
- func (tf *Terraform) SetEnv(env map[string]string)
- func (tf *Terraform) SetLogger(logger *log.Logger)
- func (tf *Terraform) StateShow(ctx context.Context) (*tfjson.State, error)
- func (tf *Terraform) StateShowCmd(ctx context.Context, args ...string) *exec.Cmd
- type UpgradeOption
- type VarFileOption
- type VarOption
- type VerifyPluginsOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindTerraform ¶
FindTerraform attempts to find a Terraform CLI executable.
As a first preference it will look for the environment variable TFEXEC_TERRAFORM_PATH and return its value. If that variable is not set, it will look in PATH for a program named "terraform", and, if one is found, return its absolute path.
Types ¶
type AddrOption ¶
type AddrOption struct {
// contains filtered or unexported fields
}
func Addr ¶
func Addr(addr string) *AddrOption
type AllowMissingConfigOption ¶
type AllowMissingConfigOption struct {
// contains filtered or unexported fields
}
func AllowMissingConfig ¶
func AllowMissingConfig(allowMissingConfig bool) *AllowMissingConfigOption
type ApplyOption ¶
type ApplyOption interface {
// contains filtered or unexported methods
}
type BackendConfigOption ¶
type BackendConfigOption struct {
// contains filtered or unexported fields
}
func BackendConfig ¶
func BackendConfig(backendConfig string) *BackendConfigOption
type BackendOption ¶
type BackendOption struct {
// contains filtered or unexported fields
}
func Backend ¶
func Backend(backend bool) *BackendOption
type BackupOption ¶
type BackupOption struct {
// contains filtered or unexported fields
}
func Backup ¶
func Backup(path string) *BackupOption
type ConfigOption ¶
type ConfigOption struct {
// contains filtered or unexported fields
}
func Config ¶
func Config(path string) *ConfigOption
type DestroyFlagOption ¶
type DestroyFlagOption struct {
// contains filtered or unexported fields
}
named to prevent conflict with DestroyOption interface
func Destroy ¶
func Destroy(destroy bool) *DestroyFlagOption
type DestroyOption ¶
type DestroyOption interface {
// contains filtered or unexported methods
}
type DirOrPlanOption ¶
type DirOrPlanOption struct {
// contains filtered or unexported fields
}
func DirOrPlan ¶
func DirOrPlan(path string) *DirOrPlanOption
type ErrCLIUsage ¶
type ErrCLIUsage struct {
// contains filtered or unexported fields
}
Terraform CLI indicates usage errors in three different ways: either 1. Exit 1, with a custom error message on stderr. 2. Exit 1, with command usage logged to stderr. 3. Exit 127, with command usage logged to stdout. Currently cases 1 and 2 are handled. TODO KEM: Handle exit 127 case. How does this work on non-Unix platforms?
func (*ErrCLIUsage) Error ¶
func (e *ErrCLIUsage) Error() string
type ErrNoConfig ¶
type ErrNoConfig struct {
// contains filtered or unexported fields
}
func (*ErrNoConfig) Error ¶
func (e *ErrNoConfig) Error() string
type ErrNoSuitableBinary ¶
type ErrNoSuitableBinary struct {
// contains filtered or unexported fields
}
func (*ErrNoSuitableBinary) Error ¶
func (e *ErrNoSuitableBinary) Error() string
type ErrVersionMismatch ¶
type ErrVersionMismatch struct{}
Not yet implemented. Intended for use when the detected Terraform version is not compatible with the command or flags being used in this invocation.
type ForceCopyOption ¶
type ForceCopyOption struct {
// contains filtered or unexported fields
}
func ForceCopy ¶
func ForceCopy(forceCopy bool) *ForceCopyOption
type FromModuleOption ¶
type FromModuleOption struct {
// contains filtered or unexported fields
}
func FromModule ¶
func FromModule(source string) *FromModuleOption
type GetPluginsOption ¶
type GetPluginsOption struct {
// contains filtered or unexported fields
}
func GetPlugins ¶
func GetPlugins(getPlugins bool) *GetPluginsOption
type ImportOption ¶
type ImportOption interface {
// contains filtered or unexported methods
}
type InitOption ¶
type InitOption interface {
// contains filtered or unexported methods
}
type LockOption ¶
type LockOption struct {
// contains filtered or unexported fields
}
func Lock ¶
func Lock(lock bool) *LockOption
type LockTimeoutOption ¶
type LockTimeoutOption struct {
// contains filtered or unexported fields
}
func LockTimeout ¶
func LockTimeout(lockTimeout string) *LockTimeoutOption
type OutputMeta ¶
type OutputMeta struct { Sensitive bool `json:"sensitive"` Type json.RawMessage `json:"type"` Value json.RawMessage `json:"value"` }
OutputMeta represents the JSON output of 'terraform output -json', which resembles state format version 3 due to a historical accident. Please see hashicorp/terraform/command/output.go. TODO KEM: Should this type be in terraform-json?
type OutputOption ¶
type OutputOption interface {
// contains filtered or unexported methods
}
type ParallelismOption ¶
type ParallelismOption struct {
// contains filtered or unexported fields
}
func Parallelism ¶
func Parallelism(n int) *ParallelismOption
type PlanOption ¶
type PlanOption interface {
// contains filtered or unexported methods
}
type PluginDirOption ¶
type PluginDirOption struct {
// contains filtered or unexported fields
}
func PluginDir ¶
func PluginDir(pluginDir string) *PluginDirOption
type ReconfigureOption ¶
type ReconfigureOption struct {
// contains filtered or unexported fields
}
func Reconfigure ¶
func Reconfigure(reconfigure bool) *ReconfigureOption
type RefreshOption ¶
type RefreshOption struct {
// contains filtered or unexported fields
}
func Refresh ¶
func Refresh(refresh bool) *RefreshOption
type StateOption ¶
type StateOption struct {
// contains filtered or unexported fields
}
func State ¶
func State(path string) *StateOption
type StateOutOption ¶
type StateOutOption struct {
// contains filtered or unexported fields
}
func StateOut ¶
func StateOut(path string) *StateOutOption
type TargetOption ¶
type TargetOption struct {
// contains filtered or unexported fields
}
func Target ¶
func Target(resource string) *TargetOption
type Terraform ¶
type Terraform struct {
// contains filtered or unexported fields
}
func NewTerraform ¶
NewTerraform returns a Terraform struct with default values for all fields. If a blank execPath is supplied, NewTerraform will attempt to locate an appropriate binary on the system PATH.
func (*Terraform) Apply ¶
func (tf *Terraform) Apply(ctx context.Context, opts ...ApplyOption) error
func (*Terraform) Destroy ¶
func (tf *Terraform) Destroy(ctx context.Context, opts ...DestroyOption) error
func (*Terraform) DestroyCmd ¶
func (*Terraform) Output ¶
func (tf *Terraform) Output(ctx context.Context, opts ...OutputOption) (map[string]OutputMeta, error)
func (*Terraform) ProvidersSchema ¶
func (*Terraform) ProvidersSchemaCmd ¶
type UpgradeOption ¶
type UpgradeOption struct {
// contains filtered or unexported fields
}
func Upgrade ¶
func Upgrade(upgrade bool) *UpgradeOption
type VarFileOption ¶
type VarFileOption struct {
// contains filtered or unexported fields
}
func VarFile ¶
func VarFile(path string) *VarFileOption
type VerifyPluginsOption ¶
type VerifyPluginsOption struct {
// contains filtered or unexported fields
}
func VerifyPlugins ¶
func VerifyPlugins(verifyPlugins bool) *VerifyPluginsOption