Documentation ¶
Index ¶
- func TestLocalProvider(t *testing.T, b *Local, name string) *terraform.MockResourceProvider
- type CountHook
- func (h *CountHook) PostApply(n *terraform.InstanceInfo, s *terraform.InstanceState, e error) (terraform.HookAction, error)
- func (h *CountHook) PostDiff(n *terraform.InstanceInfo, d *terraform.InstanceDiff) (terraform.HookAction, error)
- func (h *CountHook) PreApply(n *terraform.InstanceInfo, s *terraform.InstanceState, ...) (terraform.HookAction, error)
- func (h *CountHook) Reset()
- type Local
- func (b *Local) Colorize() *colorstring.Colorize
- func (b *Local) Configure(c *terraform.ResourceConfig) error
- func (b *Local) Context(op *backend.Operation) (*terraform.Context, state.State, error)
- func (b *Local) Input(ui terraform.UIInput, c *terraform.ResourceConfig) (*terraform.ResourceConfig, error)
- func (b *Local) Operation(ctx context.Context, op *backend.Operation) (*backend.RunningOperation, error)
- func (b *Local) State() (state.State, error)
- func (b *Local) Validate(c *terraform.ResourceConfig) ([]string, []error)
- type StateHook
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TestLocalProvider ¶
TestLocalProvider modifies the ContextOpts of the *Local parameter to have a provider with the given name.
Types ¶
type CountHook ¶
type CountHook struct { Added int Changed int Removed int ToAdd int ToChange int ToRemove int ToRemoveAndAdd int sync.Mutex terraform.NilHook // contains filtered or unexported fields }
CountHook is a hook that counts the number of resources added, removed, changed during the course of an apply.
func (*CountHook) PostApply ¶
func (h *CountHook) PostApply( n *terraform.InstanceInfo, s *terraform.InstanceState, e error) (terraform.HookAction, error)
func (*CountHook) PostDiff ¶
func (h *CountHook) PostDiff( n *terraform.InstanceInfo, d *terraform.InstanceDiff) ( terraform.HookAction, error)
func (*CountHook) PreApply ¶
func (h *CountHook) PreApply( n *terraform.InstanceInfo, s *terraform.InstanceState, d *terraform.InstanceDiff) (terraform.HookAction, error)
type Local ¶
type Local struct { // CLI and Colorize control the CLI output. If CLI is nil then no CLI // output will be done. If CLIColor is nil then no coloring will be done. CLI cli.Ui CLIColor *colorstring.Colorize // StatePath is the local path where state is read from. // // StateOutPath is the local path where the state will be written. // If this is empty, it will default to StatePath. // // StateBackupPath is the local path where a backup file will be written. // If this is empty, no backup will be taken. StatePath string StateOutPath string StateBackupPath string // ContextOpts are the base context options to set when initializing a // Terraform context. Many of these will be overridden or merged by // Operation. See Operation for more details. ContextOpts *terraform.ContextOpts // OpInput will ask for necessary input prior to performing any operations. // // OpValidation will perform validation prior to running an operation. The // variable naming doesn't match the style of others since we have a func // Validate. OpInput bool OpValidation bool // Backend, if non-nil, will use this backend for non-enhanced behavior. // This allows local behavior with remote state storage. It is a way to // "upgrade" a non-enhanced backend to an enhanced backend with typical // behavior. // // If this is nil, local performs normal state loading and storage. Backend backend.Backend // contains filtered or unexported fields }
Local is an implementation of EnhancedBackend that performs all operations locally. This is the "default" backend and implements normal Terraform behavior as it is well known.
func TestLocal ¶
TestLocal returns a configured Local struct with temporary paths and in-memory ContextOpts.
No operations will be called on the returned value, so you can still set public fields without any locks.
func (*Local) Colorize ¶
func (b *Local) Colorize() *colorstring.Colorize
Colorize returns the Colorize structure that can be used for colorizing output. This is gauranteed to always return a non-nil value and so is useful as a helper to wrap any potentially colored strings.
func (*Local) Input ¶
func (b *Local) Input( ui terraform.UIInput, c *terraform.ResourceConfig) (*terraform.ResourceConfig, error)
func (*Local) Operation ¶
func (b *Local) Operation(ctx context.Context, op *backend.Operation) (*backend.RunningOperation, error)
Operation implements backend.Enhanced
This will initialize an in-memory terraform.Context to perform the operation within this process.
The given operation parameter will be merged with the ContextOpts on the structure with the following rules. If a rule isn't specified and the name conflicts, assume that the field is overwritten if set.
type StateHook ¶
StateHook is a hook that continuously updates the state by calling WriteState on a state.State.