Documentation ¶
Index ¶
- type Apply
- type ApplyHuman
- type Operation
- type OperationHuman
- func (v *OperationHuman) Cancelled(destroy bool)
- func (v *OperationHuman) EmergencyDumpState(stateFile *statefile.File) error
- func (v *OperationHuman) FatalInterrupt()
- func (v *OperationHuman) Interrupted()
- func (v *OperationHuman) Plan(plan *plans.Plan, baseState *states.State, schemas *terraform.Schemas)
- func (v *OperationHuman) PlanNextStep(planPath string)
- func (v *OperationHuman) PlanNoChanges()
- func (v *OperationHuman) Stopping()
- type Output
- type OutputHuman
- type OutputJSON
- type OutputRaw
- type Plan
- type PlanHuman
- type Refresh
- type RefreshHuman
- type Show
- type ShowHuman
- type StateLocker
- type StateLockerHuman
- type Test
- type UiHook
- func (h *UiHook) PostApply(addr addrs.AbsResourceInstance, gen states.Generation, newState cty.Value, ...) (terraform.HookAction, error)
- func (h *UiHook) PostImportState(addr addrs.AbsResourceInstance, imported []providers.ImportedResource) (terraform.HookAction, error)
- func (h *UiHook) PreApply(addr addrs.AbsResourceInstance, gen states.Generation, action plans.Action, ...) (terraform.HookAction, error)
- func (h *UiHook) PreImportState(addr addrs.AbsResourceInstance, importID string) (terraform.HookAction, error)
- func (h *UiHook) PreProvisionInstanceStep(addr addrs.AbsResourceInstance, typeName string) (terraform.HookAction, error)
- func (h *UiHook) PreRefresh(addr addrs.AbsResourceInstance, gen states.Generation, priorState cty.Value) (terraform.HookAction, error)
- func (h *UiHook) ProvisionOutput(addr addrs.AbsResourceInstance, typeName string, msg string)
- type View
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Apply ¶
type Apply interface { ResourceCount(stateOutPath string) Outputs(outputValues map[string]*states.OutputValue) Operation() Operation Hooks() []terraform.Hook Diagnostics(diags tfdiags.Diagnostics) HelpPrompt() }
The Apply view is used for the apply command.
type ApplyHuman ¶
type ApplyHuman struct { View // contains filtered or unexported fields }
The ApplyHuman implementation renders human-readable text logs, suitable for a scrolling terminal.
func (*ApplyHuman) HelpPrompt ¶
func (v *ApplyHuman) HelpPrompt()
func (*ApplyHuman) Hooks ¶
func (v *ApplyHuman) Hooks() []terraform.Hook
func (*ApplyHuman) Operation ¶
func (v *ApplyHuman) Operation() Operation
func (*ApplyHuman) Outputs ¶
func (v *ApplyHuman) Outputs(outputValues map[string]*states.OutputValue)
func (*ApplyHuman) ResourceCount ¶
func (v *ApplyHuman) ResourceCount(stateOutPath string)
type Operation ¶
type Operation interface { Interrupted() FatalInterrupt() Stopping() Cancelled(destroy bool) EmergencyDumpState(stateFile *statefile.File) error PlanNoChanges() Plan(plan *plans.Plan, baseState *states.State, schemas *terraform.Schemas) PlanNextStep(planPath string) Diagnostics(diags tfdiags.Diagnostics) }
type OperationHuman ¶
type OperationHuman struct { View // contains filtered or unexported fields }
func (*OperationHuman) Cancelled ¶
func (v *OperationHuman) Cancelled(destroy bool)
func (*OperationHuman) EmergencyDumpState ¶
func (v *OperationHuman) EmergencyDumpState(stateFile *statefile.File) error
func (*OperationHuman) FatalInterrupt ¶
func (v *OperationHuman) FatalInterrupt()
func (*OperationHuman) Interrupted ¶
func (v *OperationHuman) Interrupted()
func (*OperationHuman) PlanNextStep ¶
func (v *OperationHuman) PlanNextStep(planPath string)
PlanNextStep gives the user some next-steps, unless we're running in an automation tool which is presumed to provide its own UI for further actions.
func (*OperationHuman) PlanNoChanges ¶
func (v *OperationHuman) PlanNoChanges()
func (*OperationHuman) Stopping ¶
func (v *OperationHuman) Stopping()
type Output ¶
type Output interface { Output(name string, outputs map[string]*states.OutputValue) tfdiags.Diagnostics Diagnostics(diags tfdiags.Diagnostics) }
The Output view renders either one or all outputs, depending on whether or not the name argument is empty.
type OutputHuman ¶
type OutputHuman struct {
View
}
The OutputHuman implementation renders outputs in a format equivalent to HCL source. This uses the same formatting logic as in the console REPL.
func (*OutputHuman) Output ¶
func (v *OutputHuman) Output(name string, outputs map[string]*states.OutputValue) tfdiags.Diagnostics
type OutputJSON ¶
type OutputJSON struct {
View
}
The OutputJSON implementation renders outputs as JSON values. When rendering a single output, only the value is displayed. When rendering all outputs, the result is a JSON object with keys matching the output names and object values including type and sensitivity metadata.
func (*OutputJSON) Output ¶
func (v *OutputJSON) Output(name string, outputs map[string]*states.OutputValue) tfdiags.Diagnostics
type OutputRaw ¶
type OutputRaw struct { View // contains filtered or unexported fields }
The OutputRaw implementation renders single string, number, or boolean output values directly and without quotes or other formatting. This is intended for use in shell scripting or other environments where the exact type of an output value is not important.
func (*OutputRaw) Output ¶
func (v *OutputRaw) Output(name string, outputs map[string]*states.OutputValue) tfdiags.Diagnostics
type Plan ¶
type Plan interface { Operation() Operation Hooks() []terraform.Hook Diagnostics(diags tfdiags.Diagnostics) HelpPrompt(string) }
The Plan view is used for the plan command.
type PlanHuman ¶
type PlanHuman struct { View // contains filtered or unexported fields }
The PlanHuman implementation renders human-readable text logs, suitable for a scrolling terminal.
type Refresh ¶
type Refresh interface { Outputs(outputValues map[string]*states.OutputValue) Operation() Operation Hooks() []terraform.Hook Diagnostics(diags tfdiags.Diagnostics) HelpPrompt(command string) }
The Refresh view is used for the refresh command.
type RefreshHuman ¶
type RefreshHuman struct { View // contains filtered or unexported fields }
The RefreshHuman implementation renders human-readable text logs, suitable for a scrolling terminal.
func (*RefreshHuman) Hooks ¶
func (v *RefreshHuman) Hooks() []terraform.Hook
func (*RefreshHuman) Operation ¶
func (v *RefreshHuman) Operation() Operation
func (*RefreshHuman) Outputs ¶
func (v *RefreshHuman) Outputs(outputValues map[string]*states.OutputValue)
type Show ¶
FIXME: this is a temporary partial definition of the view for the show command, in place to allow access to the plan renderer which is now in the views package.
type StateLocker ¶
type StateLocker interface { Locking() Unlocking() }
The StateLocker view is used to display locking/unlocking status messages if the state lock process takes longer than expected.
func NewStateLocker ¶
func NewStateLocker(vt arguments.ViewType, view *View) StateLocker
NewStateLocker returns an initialized StateLocker implementation for the given ViewType.
type StateLockerHuman ¶
type StateLockerHuman struct {
View
}
StateLockerHuman is an implementation of StateLocker which prints status to a terminal.
func (*StateLockerHuman) Locking ¶
func (v *StateLockerHuman) Locking()
func (*StateLockerHuman) Unlocking ¶
func (v *StateLockerHuman) Unlocking()
type Test ¶
type Test interface { // Results presents the given test results. Results(map[string]*moduletest.Suite) tfdiags.Diagnostics // Diagnostics is for reporting warnings or errors that occurred with the // mechanics of running tests. For this command in particular, some // errors are considered to be test failures rather than mechanism failures, // and so those will be reported via Results rather than via Diagnostics. Diagnostics(tfdiags.Diagnostics) }
Test is the view interface for the "terraform test" command.
type UiHook ¶
func (*UiHook) PostApply ¶
func (h *UiHook) PostApply(addr addrs.AbsResourceInstance, gen states.Generation, newState cty.Value, applyerr error) (terraform.HookAction, error)
func (*UiHook) PostImportState ¶
func (h *UiHook) PostImportState(addr addrs.AbsResourceInstance, imported []providers.ImportedResource) (terraform.HookAction, error)
func (*UiHook) PreApply ¶
func (h *UiHook) PreApply(addr addrs.AbsResourceInstance, gen states.Generation, action plans.Action, priorState, plannedNewState cty.Value) (terraform.HookAction, error)
func (*UiHook) PreImportState ¶
func (h *UiHook) PreImportState(addr addrs.AbsResourceInstance, importID string) (terraform.HookAction, error)
func (*UiHook) PreProvisionInstanceStep ¶
func (h *UiHook) PreProvisionInstanceStep(addr addrs.AbsResourceInstance, typeName string) (terraform.HookAction, error)
func (*UiHook) PreRefresh ¶
func (h *UiHook) PreRefresh(addr addrs.AbsResourceInstance, gen states.Generation, priorState cty.Value) (terraform.HookAction, error)
func (*UiHook) ProvisionOutput ¶
func (h *UiHook) ProvisionOutput(addr addrs.AbsResourceInstance, typeName string, msg string)
type View ¶
type View struct {
// contains filtered or unexported fields
}
View is the base layer for command views, encapsulating a set of I/O streams, a colorize implementation, and implementing a human friendly view for diagnostics.
func NewView ¶
Initialize a View with the given streams, a disabled colorize object, and a no-op configSources callback.
func (*View) Diagnostics ¶
func (v *View) Diagnostics(diags tfdiags.Diagnostics)
Diagnostics renders a set of warnings and errors in human-readable form. Warnings are printed to stdout, and errors to stderr.
func (*View) HelpPrompt ¶
HelpPrompt is intended to be called from commands which fail to parse all of their CLI arguments successfully. It refers users to the full help output rather than rendering it directly, which can be overwhelming and confusing.
func (*View) SetConfigSources ¶
SetConfigSources overrides the default no-op callback with a new function pointer, and should be called when the config loader is initialized.