Documentation
¶
Index ¶
- type AllowMissingConfigOption
- type ApplyOption
- type BackendConfigOption
- type BackendOption
- type BackupOption
- type ConfigOption
- type DestroyFlagOption
- type DestroyOption
- type DirOrPlanOption
- type Err
- type ErrCLIUsage
- type ErrManualEnvVar
- type ErrNoConfig
- type ErrNoInit
- type ErrNoSuitableBinary
- type ErrVersionMismatch
- type ForceCopyOption
- type FromModuleOption
- type GetOption
- type GetPluginsOption
- 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) Destroy(ctx context.Context, opts ...DestroyOption) error
- func (t *Terraform) Import(ctx context.Context, address, id string, opts ...ImportOption) error
- func (t *Terraform) Init(ctx context.Context, opts ...InitOption) error
- func (tf *Terraform) Output(ctx context.Context, opts ...OutputOption) (map[string]OutputMeta, error)
- func (tf *Terraform) Plan(ctx context.Context, opts ...PlanOption) error
- func (tf *Terraform) ProvidersSchema(ctx context.Context) (*tfjson.ProviderSchemas, error)
- func (tf *Terraform) SetEnv(env map[string]string) error
- func (tf *Terraform) SetLogPath(path string) error
- func (tf *Terraform) SetLogger(logger *log.Logger)
- func (tf *Terraform) Show(ctx context.Context) (*tfjson.State, error)
- func (tf *Terraform) Version(ctx context.Context, skipCache bool) (tfVersion *version.Version, providerVersions map[string]*version.Version, ...)
- type UpgradeOption
- type VarFileOption
- type VarOption
- type VerifyPluginsOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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
func DisableBackup ¶ added in v0.3.0
func DisableBackup() *BackupOption
DisableBackup is a convenience method for Backup("-"), indicating backup state should be disabled.
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 ErrManualEnvVar ¶ added in v0.4.0
type ErrManualEnvVar struct {
// contains filtered or unexported fields
}
ErrManualEnvVar is returned when an env var that should be set programatically via an option or method is set via the manual environment passing functions.
func (*ErrManualEnvVar) Error ¶ added in v0.4.0
func (err *ErrManualEnvVar) 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) Output ¶
func (tf *Terraform) Output(ctx context.Context, opts ...OutputOption) (map[string]OutputMeta, error)
func (*Terraform) ProvidersSchema ¶
func (*Terraform) SetEnv ¶
SetEnv allows you to override environment variables, this should not be used for any well known Terraform environment variables that are already covered in options. Pass nil to copy the values from os.Environ. Attempting to set environment variables that should be managed manually will result in ErrManualEnvVar being returned.
func (*Terraform) SetLogPath ¶ added in v0.4.0
SetLogPath sets the TF_LOG_PATH environment variable for Terraform CLI execution.
func (*Terraform) Version ¶ added in v0.4.0
func (tf *Terraform) Version(ctx context.Context, skipCache bool) (tfVersion *version.Version, providerVersions map[string]*version.Version, err error)
Version returns structured output from the terraform version command including both the Terraform CLI version and any initialized provider versions. This will read cached values when present unless the skipCache parameter is set to true.
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