Documentation ¶
Index ¶
- Constants
- func SaveErroredTestStateFile(state *states.State, run *moduletest.Run, file *moduletest.File, view Test)
- type Apply
- type ApplyHuman
- func (v *ApplyHuman) Diagnostics(diags tfdiags.Diagnostics)
- func (v *ApplyHuman) HelpPrompt()
- func (v *ApplyHuman) Hooks() []tofu.Hook
- func (v *ApplyHuman) Operation() Operation
- func (v *ApplyHuman) Outputs(outputValues map[string]*states.OutputValue)
- func (v *ApplyHuman) ResourceCount(stateOutPath string)
- type ApplyJSON
- func (v *ApplyJSON) Diagnostics(diags tfdiags.Diagnostics)
- func (v *ApplyJSON) HelpPrompt()
- func (v *ApplyJSON) Hooks() []tofu.Hook
- func (v *ApplyJSON) Operation() Operation
- func (v *ApplyJSON) Outputs(outputValues map[string]*states.OutputValue)
- func (v *ApplyJSON) ResourceCount(stateOutPath string)
- type JSONView
- func (v *JSONView) ChangeSummary(cs *json.ChangeSummary)
- func (v *JSONView) Diagnostics(diags tfdiags.Diagnostics, metadata ...interface{})
- func (v *JSONView) Error(message string)
- func (v *JSONView) Hook(h json.Hook)
- func (v *JSONView) Info(message string)
- func (v *JSONView) Log(message string)
- func (v *JSONView) Output(message string)
- func (v *JSONView) Outputs(outputs json.Outputs)
- func (v *JSONView) PlannedChange(c *json.ResourceInstanceChange)
- func (v *JSONView) ResourceDrift(c *json.ResourceInstanceChange)
- func (v *JSONView) StateDump(state string)
- func (v *JSONView) Version()
- func (v *JSONView) Warn(message string)
- type Operation
- type OperationHuman
- func (v *OperationHuman) Cancelled(planMode plans.Mode)
- func (v *OperationHuman) Diagnostics(diags tfdiags.Diagnostics)
- func (v *OperationHuman) EmergencyDumpState(stateFile *statefile.File, enc encryption.StateEncryption) error
- func (v *OperationHuman) FatalInterrupt()
- func (v *OperationHuman) Interrupted()
- func (v *OperationHuman) Plan(plan *plans.Plan, schemas *tofu.Schemas)
- func (v *OperationHuman) PlanNextStep(planPath string, genConfigPath string)
- func (v *OperationHuman) PlannedChange(change *plans.ResourceInstanceChangeSrc)
- func (v *OperationHuman) Stopping()
- type OperationJSON
- func (v *OperationJSON) Cancelled(planMode plans.Mode)
- func (v *OperationJSON) Diagnostics(diags tfdiags.Diagnostics)
- func (v *OperationJSON) EmergencyDumpState(stateFile *statefile.File, enc encryption.StateEncryption) error
- func (v *OperationJSON) FatalInterrupt()
- func (v *OperationJSON) Interrupted()
- func (v *OperationJSON) Plan(plan *plans.Plan, schemas *tofu.Schemas)
- func (v *OperationJSON) PlanNextStep(planPath string, genConfigPath string)
- func (v *OperationJSON) PlannedChange(change *plans.ResourceInstanceChangeSrc)
- func (v *OperationJSON) Stopping()
- type Output
- type OutputHuman
- type OutputJSON
- type OutputRaw
- type Plan
- type PlanHuman
- type PlanJSON
- type Refresh
- type RefreshHuman
- type RefreshJSON
- type Show
- type ShowHuman
- type ShowJSON
- type StateLocker
- type StateLockerHuman
- type StateLockerJSON
- type Test
- type TestHuman
- func (t *TestHuman) Abstract(_ *moduletest.Suite)
- func (t *TestHuman) Conclusion(suite *moduletest.Suite)
- func (t *TestHuman) DestroySummary(diags tfdiags.Diagnostics, run *moduletest.Run, file *moduletest.File, ...)
- func (t *TestHuman) Diagnostics(_ *moduletest.Run, _ *moduletest.File, diags tfdiags.Diagnostics)
- func (t *TestHuman) FatalInterrupt()
- func (t *TestHuman) FatalInterruptSummary(run *moduletest.Run, file *moduletest.File, ...)
- func (t *TestHuman) File(file *moduletest.File)
- func (t *TestHuman) Interrupted()
- func (t *TestHuman) Run(run *moduletest.Run, file *moduletest.File)
- type TestJSON
- func (t *TestJSON) Abstract(suite *moduletest.Suite)
- func (t *TestJSON) Conclusion(suite *moduletest.Suite)
- func (t *TestJSON) DestroySummary(diags tfdiags.Diagnostics, run *moduletest.Run, file *moduletest.File, ...)
- func (t *TestJSON) Diagnostics(run *moduletest.Run, file *moduletest.File, diags tfdiags.Diagnostics)
- func (t *TestJSON) FatalInterrupt()
- func (t *TestJSON) FatalInterruptSummary(run *moduletest.Run, file *moduletest.File, ...)
- func (t *TestJSON) File(file *moduletest.File)
- func (t *TestJSON) Interrupted()
- func (t *TestJSON) Run(run *moduletest.Run, file *moduletest.File)
- type UiHook
- func (h *UiHook) PostApply(addr addrs.AbsResourceInstance, gen states.Generation, newState cty.Value, ...) (tofu.HookAction, error)
- func (h *UiHook) PostApplyImport(addr addrs.AbsResourceInstance, importing plans.ImportingSrc) (tofu.HookAction, error)
- func (h *UiHook) PostImportState(addr addrs.AbsResourceInstance, imported []providers.ImportedResource) (tofu.HookAction, error)
- func (h *UiHook) PreApply(addr addrs.AbsResourceInstance, gen states.Generation, action plans.Action, ...) (tofu.HookAction, error)
- func (h *UiHook) PreApplyImport(addr addrs.AbsResourceInstance, importing plans.ImportingSrc) (tofu.HookAction, error)
- func (h *UiHook) PreImportState(addr addrs.AbsResourceInstance, importID string) (tofu.HookAction, error)
- func (h *UiHook) PrePlanImport(addr addrs.AbsResourceInstance, importID string) (tofu.HookAction, error)
- func (h *UiHook) PreProvisionInstanceStep(addr addrs.AbsResourceInstance, typeName string) (tofu.HookAction, error)
- func (h *UiHook) PreRefresh(addr addrs.AbsResourceInstance, gen states.Generation, priorState cty.Value) (tofu.HookAction, error)
- func (h *UiHook) ProvisionOutput(addr addrs.AbsResourceInstance, typeName string, msg string)
- type Validate
- type ValidateHuman
- type ValidateJSON
- type View
- func (v *View) Configure(view *arguments.View)
- func (v *View) Diagnostics(diags tfdiags.Diagnostics)
- func (v *View) HelpPrompt(command string)
- func (v *View) RunningInAutomation() bool
- func (v *View) SetConfigSources(cb func() map[string]*hcl.File)
- func (v *View) SetRunningInAutomation(new bool) *View
- func (v *View) SetShowSensitive(showSensitive bool)
Constants ¶
const JSON_UI_VERSION = "1.2"
This version describes the schema of JSON UI messages. This version must be updated after making any changes to this view, the jsonHook, or any of the command/views/json package.
Variables ¶
This section is empty.
Functions ¶
func SaveErroredTestStateFile ¶
func SaveErroredTestStateFile(state *states.State, run *moduletest.Run, file *moduletest.File, view Test)
SaveErroredTestStateFile is a helper function to invoked in DestorySummary to store the state to errored_test.tfstate and handle associated diagnostics and errors with this operation
Types ¶
type Apply ¶
type Apply interface { ResourceCount(stateOutPath string) Outputs(outputValues map[string]*states.OutputValue) Operation() Operation Hooks() []tofu.Hook Diagnostics(diags tfdiags.Diagnostics) HelpPrompt() }
The Apply view is used for the apply command.
type ApplyHuman ¶
type ApplyHuman struct {
// contains filtered or unexported fields
}
The ApplyHuman implementation renders human-readable text logs, suitable for a scrolling terminal.
func (*ApplyHuman) Diagnostics ¶
func (v *ApplyHuman) Diagnostics(diags tfdiags.Diagnostics)
func (*ApplyHuman) HelpPrompt ¶
func (v *ApplyHuman) HelpPrompt()
func (*ApplyHuman) Hooks ¶
func (v *ApplyHuman) Hooks() []tofu.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 ApplyJSON ¶
type ApplyJSON struct {
// contains filtered or unexported fields
}
The ApplyJSON implementation renders streaming JSON logs, suitable for integrating with other software.
func (*ApplyJSON) Diagnostics ¶
func (v *ApplyJSON) Diagnostics(diags tfdiags.Diagnostics)
func (*ApplyJSON) HelpPrompt ¶
func (v *ApplyJSON) HelpPrompt()
func (*ApplyJSON) Outputs ¶
func (v *ApplyJSON) Outputs(outputValues map[string]*states.OutputValue)
func (*ApplyJSON) ResourceCount ¶
type JSONView ¶
type JSONView struct {
// contains filtered or unexported fields
}
func NewJSONView ¶
func (*JSONView) ChangeSummary ¶
func (v *JSONView) ChangeSummary(cs *json.ChangeSummary)
func (*JSONView) Diagnostics ¶
func (v *JSONView) Diagnostics(diags tfdiags.Diagnostics, metadata ...interface{})
func (*JSONView) PlannedChange ¶
func (v *JSONView) PlannedChange(c *json.ResourceInstanceChange)
func (*JSONView) ResourceDrift ¶
func (v *JSONView) ResourceDrift(c *json.ResourceInstanceChange)
type Operation ¶
type Operation interface { Interrupted() FatalInterrupt() Stopping() Cancelled(planMode plans.Mode) EmergencyDumpState(stateFile *statefile.File, enc encryption.StateEncryption) error PlannedChange(change *plans.ResourceInstanceChangeSrc) Plan(plan *plans.Plan, schemas *tofu.Schemas) PlanNextStep(planPath string, genConfigPath string) Diagnostics(diags tfdiags.Diagnostics) }
type OperationHuman ¶
type OperationHuman struct {
// contains filtered or unexported fields
}
func (*OperationHuman) Cancelled ¶
func (v *OperationHuman) Cancelled(planMode plans.Mode)
func (*OperationHuman) Diagnostics ¶
func (v *OperationHuman) Diagnostics(diags tfdiags.Diagnostics)
func (*OperationHuman) EmergencyDumpState ¶
func (v *OperationHuman) EmergencyDumpState(stateFile *statefile.File, enc encryption.StateEncryption) error
func (*OperationHuman) FatalInterrupt ¶
func (v *OperationHuman) FatalInterrupt()
func (*OperationHuman) Interrupted ¶
func (v *OperationHuman) Interrupted()
func (*OperationHuman) Plan ¶
func (v *OperationHuman) Plan(plan *plans.Plan, schemas *tofu.Schemas)
func (*OperationHuman) PlanNextStep ¶
func (v *OperationHuman) PlanNextStep(planPath string, genConfigPath 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) PlannedChange ¶
func (v *OperationHuman) PlannedChange(change *plans.ResourceInstanceChangeSrc)
func (*OperationHuman) Stopping ¶
func (v *OperationHuman) Stopping()
type OperationJSON ¶
type OperationJSON struct {
// contains filtered or unexported fields
}
func (*OperationJSON) Cancelled ¶
func (v *OperationJSON) Cancelled(planMode plans.Mode)
func (*OperationJSON) Diagnostics ¶
func (v *OperationJSON) Diagnostics(diags tfdiags.Diagnostics)
func (*OperationJSON) EmergencyDumpState ¶
func (v *OperationJSON) EmergencyDumpState(stateFile *statefile.File, enc encryption.StateEncryption) error
func (*OperationJSON) FatalInterrupt ¶
func (v *OperationJSON) FatalInterrupt()
func (*OperationJSON) Interrupted ¶
func (v *OperationJSON) Interrupted()
func (*OperationJSON) Plan ¶
func (v *OperationJSON) Plan(plan *plans.Plan, schemas *tofu.Schemas)
Log a change summary and a series of "planned" messages for the changes in the plan.
func (*OperationJSON) PlanNextStep ¶
func (v *OperationJSON) PlanNextStep(planPath string, genConfigPath string)
PlanNextStep does nothing for the JSON view as it is a hook for user-facing output only applicable to human-readable UI.
func (*OperationJSON) PlannedChange ¶
func (v *OperationJSON) PlannedChange(change *plans.ResourceInstanceChangeSrc)
func (*OperationJSON) Stopping ¶
func (v *OperationJSON) 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 {
// contains filtered or unexported fields
}
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) Diagnostics ¶
func (v *OutputHuman) Diagnostics(diags tfdiags.Diagnostics)
func (*OutputHuman) Output ¶
func (v *OutputHuman) Output(name string, outputs map[string]*states.OutputValue) tfdiags.Diagnostics
type OutputJSON ¶
type OutputJSON struct {
// contains filtered or unexported fields
}
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) Diagnostics ¶
func (v *OutputJSON) Diagnostics(diags tfdiags.Diagnostics)
func (*OutputJSON) Output ¶
func (v *OutputJSON) Output(name string, outputs map[string]*states.OutputValue) tfdiags.Diagnostics
type OutputRaw ¶
type OutputRaw struct {
// 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) Diagnostics ¶
func (v *OutputRaw) Diagnostics(diags tfdiags.Diagnostics)
func (*OutputRaw) Output ¶
func (v *OutputRaw) Output(name string, outputs map[string]*states.OutputValue) tfdiags.Diagnostics
type Plan ¶
type Plan interface { Operation() Operation Hooks() []tofu.Hook Diagnostics(diags tfdiags.Diagnostics) HelpPrompt() }
The Plan view is used for the plan command.
type PlanHuman ¶
type PlanHuman struct {
// contains filtered or unexported fields
}
The PlanHuman implementation renders human-readable text logs, suitable for a scrolling terminal.
func (*PlanHuman) Diagnostics ¶
func (v *PlanHuman) Diagnostics(diags tfdiags.Diagnostics)
func (*PlanHuman) HelpPrompt ¶
func (v *PlanHuman) HelpPrompt()
type PlanJSON ¶
type PlanJSON struct {
// contains filtered or unexported fields
}
The PlanJSON implementation renders streaming JSON logs, suitable for integrating with other software.
func (*PlanJSON) Diagnostics ¶
func (v *PlanJSON) Diagnostics(diags tfdiags.Diagnostics)
func (*PlanJSON) HelpPrompt ¶
func (v *PlanJSON) HelpPrompt()
type Refresh ¶
type Refresh interface { Outputs(outputValues map[string]*states.OutputValue) Operation() Operation Hooks() []tofu.Hook Diagnostics(diags tfdiags.Diagnostics) HelpPrompt() }
The Refresh view is used for the refresh command.
type RefreshHuman ¶
type RefreshHuman struct {
// contains filtered or unexported fields
}
The RefreshHuman implementation renders human-readable text logs, suitable for a scrolling terminal.
func (*RefreshHuman) Diagnostics ¶
func (v *RefreshHuman) Diagnostics(diags tfdiags.Diagnostics)
func (*RefreshHuman) HelpPrompt ¶
func (v *RefreshHuman) HelpPrompt()
func (*RefreshHuman) Hooks ¶
func (v *RefreshHuman) Hooks() []tofu.Hook
func (*RefreshHuman) Operation ¶
func (v *RefreshHuman) Operation() Operation
func (*RefreshHuman) Outputs ¶
func (v *RefreshHuman) Outputs(outputValues map[string]*states.OutputValue)
type RefreshJSON ¶
type RefreshJSON struct {
// contains filtered or unexported fields
}
The RefreshJSON implementation renders streaming JSON logs, suitable for integrating with other software.
func (*RefreshJSON) Diagnostics ¶
func (v *RefreshJSON) Diagnostics(diags tfdiags.Diagnostics)
func (*RefreshJSON) HelpPrompt ¶
func (v *RefreshJSON) HelpPrompt()
func (*RefreshJSON) Hooks ¶
func (v *RefreshJSON) Hooks() []tofu.Hook
func (*RefreshJSON) Operation ¶
func (v *RefreshJSON) Operation() Operation
func (*RefreshJSON) Outputs ¶
func (v *RefreshJSON) Outputs(outputValues map[string]*states.OutputValue)
type Show ¶
type Show interface { // Display renders the plan, if it is available. If plan is nil, it renders the statefile. Display(config *configs.Config, plan *plans.Plan, planJSON *cloudplan.RemotePlanJSON, stateFile *statefile.File, schemas *tofu.Schemas) int // Diagnostics renders early diagnostics, resulting from argument parsing. Diagnostics(diags tfdiags.Diagnostics) }
type ShowHuman ¶
type ShowHuman struct {
// contains filtered or unexported fields
}
func (*ShowHuman) Diagnostics ¶
func (v *ShowHuman) Diagnostics(diags tfdiags.Diagnostics)
type ShowJSON ¶
type ShowJSON struct {
// contains filtered or unexported fields
}
func (*ShowJSON) Diagnostics ¶
func (v *ShowJSON) Diagnostics(diags tfdiags.Diagnostics)
Diagnostics should only be called if show cannot be executed. In this case, we choose to render human-readable diagnostic output, primarily for backwards compatibility.
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 {
// contains filtered or unexported fields
}
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 StateLockerJSON ¶
type StateLockerJSON struct {
// contains filtered or unexported fields
}
StateLockerJSON is an implementation of StateLocker which prints the state lock status to a terminal in machine-readable JSON form.
func (*StateLockerJSON) Locking ¶
func (v *StateLockerJSON) Locking()
func (*StateLockerJSON) Unlocking ¶
func (v *StateLockerJSON) Unlocking()
type Test ¶
type Test interface { // Abstract should print an early summary of the tests that will be // executed. This will be called before the tests have been executed so // the status for everything within suite will be test.Pending. // // This should be used to state what is going to be tested. Abstract(suite *moduletest.Suite) // Conclusion should print out a summary of the tests including their // completed status. Conclusion(suite *moduletest.Suite) // File prints out the summary for an entire test file. File(file *moduletest.File) // Run prints out the summary for a single test run block. Run(run *moduletest.Run, file *moduletest.File) // DestroySummary prints out the summary of the destroy step of each test // file. If everything goes well, this should be empty. DestroySummary(diags tfdiags.Diagnostics, run *moduletest.Run, file *moduletest.File, state *states.State) // Diagnostics prints out the provided diagnostics. Diagnostics(run *moduletest.Run, file *moduletest.File, diags tfdiags.Diagnostics) // Interrupted prints out a message stating that an interrupt has been // received and testing will stop. Interrupted() // FatalInterrupt prints out a message stating that a hard interrupt has // been received and testing will stop and cleanup will be skipped. FatalInterrupt() // FatalInterruptSummary prints out the resources that were held in state // and were being created at the time the FatalInterrupt was received. // // This will typically be called in place of DestroySummary, as there is no // guarantee that this function will be called during a FatalInterrupt. In // addition, this function prints additional details about the current // operation alongside the current state as the state will be missing newly // created resources that also need to be handled manually. FatalInterruptSummary(run *moduletest.Run, file *moduletest.File, states map[*moduletest.Run]*states.State, created []*plans.ResourceInstanceChangeSrc) }
Test renders outputs for test executions.
type TestHuman ¶
type TestHuman struct {
// contains filtered or unexported fields
}
func (*TestHuman) Abstract ¶
func (t *TestHuman) Abstract(_ *moduletest.Suite)
func (*TestHuman) Conclusion ¶
func (t *TestHuman) Conclusion(suite *moduletest.Suite)
func (*TestHuman) DestroySummary ¶
func (t *TestHuman) DestroySummary(diags tfdiags.Diagnostics, run *moduletest.Run, file *moduletest.File, state *states.State)
func (*TestHuman) Diagnostics ¶
func (t *TestHuman) Diagnostics(_ *moduletest.Run, _ *moduletest.File, diags tfdiags.Diagnostics)
func (*TestHuman) FatalInterrupt ¶
func (t *TestHuman) FatalInterrupt()
func (*TestHuman) FatalInterruptSummary ¶
func (t *TestHuman) FatalInterruptSummary(run *moduletest.Run, file *moduletest.File, existingStates map[*moduletest.Run]*states.State, created []*plans.ResourceInstanceChangeSrc)
func (*TestHuman) File ¶
func (t *TestHuman) File(file *moduletest.File)
func (*TestHuman) Interrupted ¶
func (t *TestHuman) Interrupted()
func (*TestHuman) Run ¶
func (t *TestHuman) Run(run *moduletest.Run, file *moduletest.File)
type TestJSON ¶
type TestJSON struct {
// contains filtered or unexported fields
}
func (*TestJSON) Abstract ¶
func (t *TestJSON) Abstract(suite *moduletest.Suite)
func (*TestJSON) Conclusion ¶
func (t *TestJSON) Conclusion(suite *moduletest.Suite)
func (*TestJSON) DestroySummary ¶
func (t *TestJSON) DestroySummary(diags tfdiags.Diagnostics, run *moduletest.Run, file *moduletest.File, state *states.State)
func (*TestJSON) Diagnostics ¶
func (t *TestJSON) Diagnostics(run *moduletest.Run, file *moduletest.File, diags tfdiags.Diagnostics)
func (*TestJSON) FatalInterrupt ¶
func (t *TestJSON) FatalInterrupt()
func (*TestJSON) FatalInterruptSummary ¶
func (t *TestJSON) FatalInterruptSummary(run *moduletest.Run, file *moduletest.File, existingStates map[*moduletest.Run]*states.State, created []*plans.ResourceInstanceChangeSrc)
func (*TestJSON) File ¶
func (t *TestJSON) File(file *moduletest.File)
func (*TestJSON) Interrupted ¶
func (t *TestJSON) Interrupted()
func (*TestJSON) Run ¶
func (t *TestJSON) Run(run *moduletest.Run, file *moduletest.File)
type UiHook ¶
func (*UiHook) PostApply ¶
func (h *UiHook) PostApply(addr addrs.AbsResourceInstance, gen states.Generation, newState cty.Value, applyerr error) (tofu.HookAction, error)
func (*UiHook) PostApplyImport ¶
func (h *UiHook) PostApplyImport(addr addrs.AbsResourceInstance, importing plans.ImportingSrc) (tofu.HookAction, error)
func (*UiHook) PostImportState ¶
func (h *UiHook) PostImportState(addr addrs.AbsResourceInstance, imported []providers.ImportedResource) (tofu.HookAction, error)
func (*UiHook) PreApply ¶
func (h *UiHook) PreApply(addr addrs.AbsResourceInstance, gen states.Generation, action plans.Action, priorState, plannedNewState cty.Value) (tofu.HookAction, error)
func (*UiHook) PreApplyImport ¶
func (h *UiHook) PreApplyImport(addr addrs.AbsResourceInstance, importing plans.ImportingSrc) (tofu.HookAction, error)
func (*UiHook) PreImportState ¶
func (h *UiHook) PreImportState(addr addrs.AbsResourceInstance, importID string) (tofu.HookAction, error)
func (*UiHook) PrePlanImport ¶
func (h *UiHook) PrePlanImport(addr addrs.AbsResourceInstance, importID string) (tofu.HookAction, error)
func (*UiHook) PreProvisionInstanceStep ¶
func (h *UiHook) PreProvisionInstanceStep(addr addrs.AbsResourceInstance, typeName string) (tofu.HookAction, error)
func (*UiHook) PreRefresh ¶
func (h *UiHook) PreRefresh(addr addrs.AbsResourceInstance, gen states.Generation, priorState cty.Value) (tofu.HookAction, error)
func (*UiHook) ProvisionOutput ¶
func (h *UiHook) ProvisionOutput(addr addrs.AbsResourceInstance, typeName string, msg string)
type Validate ¶
type Validate interface { // Results renders the diagnostics returned from a validation walk, and // returns a CLI exit code: 0 if there are no errors, 1 otherwise Results(diags tfdiags.Diagnostics) int // Diagnostics renders early diagnostics, resulting from argument parsing. Diagnostics(diags tfdiags.Diagnostics) }
The Validate is used for the validate command.
type ValidateHuman ¶
type ValidateHuman struct {
// contains filtered or unexported fields
}
The ValidateHuman implementation renders diagnostics in a human-readable form, along with a success/failure message if OpenTofu is able to execute the validation walk.
func (*ValidateHuman) Diagnostics ¶
func (v *ValidateHuman) Diagnostics(diags tfdiags.Diagnostics)
func (*ValidateHuman) Results ¶
func (v *ValidateHuman) Results(diags tfdiags.Diagnostics) int
type ValidateJSON ¶
type ValidateJSON struct {
// contains filtered or unexported fields
}
The ValidateJSON implementation renders validation results as a JSON object. This object includes top-level fields summarizing the result, and an array of JSON diagnostic objects.
func (*ValidateJSON) Diagnostics ¶
func (v *ValidateJSON) Diagnostics(diags tfdiags.Diagnostics)
Diagnostics should only be called if the validation walk cannot be executed. In this case, we choose to render human-readable diagnostic output, primarily for backwards compatibility.
func (*ValidateJSON) Results ¶
func (v *ValidateJSON) Results(diags tfdiags.Diagnostics) int
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) RunningInAutomation ¶
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.
func (*View) SetRunningInAutomation ¶
SetRunningInAutomation modifies the view's "running in automation" flag, which causes some slight adjustments to certain messages that would normally suggest specific OpenTofu commands to run, to make more conceptual gestures instead for situations where the user isn't running OpenTofu directly.
For convenient use during initialization (in conjunction with NewView), SetRunningInAutomation returns the reciever after modifying it.