|
|
|
|
@ -75,10 +75,21 @@ type Hook interface {
|
|
|
|
|
PostRefresh(addr addrs.AbsResourceInstance, gen states.Generation, priorState cty.Value, newState cty.Value) (HookAction, error)
|
|
|
|
|
|
|
|
|
|
// PreImportState and PostImportState are called before and after
|
|
|
|
|
// (respectively) each state import operation for a given resource address.
|
|
|
|
|
// (respectively) each state import operation for a given resource address when
|
|
|
|
|
// using the legacy import command.
|
|
|
|
|
PreImportState(addr addrs.AbsResourceInstance, importID string) (HookAction, error)
|
|
|
|
|
PostImportState(addr addrs.AbsResourceInstance, imported []providers.ImportedResource) (HookAction, error)
|
|
|
|
|
|
|
|
|
|
// PrePlanImport and PostPlanImport are called during a plan before and after planning to import
|
|
|
|
|
// a new resource using the configuration-driven import workflow.
|
|
|
|
|
PrePlanImport(addr addrs.AbsResourceInstance, importID string) (HookAction, error)
|
|
|
|
|
PostPlanImport(addr addrs.AbsResourceInstance, imported []providers.ImportedResource) (HookAction, error)
|
|
|
|
|
|
|
|
|
|
// PreApplyImport and PostApplyImport are called during an apply for each imported resource when
|
|
|
|
|
// using the configuration-driven import workflow.
|
|
|
|
|
PreApplyImport(addr addrs.AbsResourceInstance, importing plans.ImportingSrc) (HookAction, error)
|
|
|
|
|
PostApplyImport(addr addrs.AbsResourceInstance, importing plans.ImportingSrc) (HookAction, error)
|
|
|
|
|
|
|
|
|
|
// Stopping is called if an external signal requests that Terraform
|
|
|
|
|
// gracefully abort an operation in progress.
|
|
|
|
|
//
|
|
|
|
|
@ -159,6 +170,22 @@ func (*NilHook) PostImportState(addr addrs.AbsResourceInstance, imported []provi
|
|
|
|
|
return HookActionContinue, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (h *NilHook) PrePlanImport(addr addrs.AbsResourceInstance, importID string) (HookAction, error) {
|
|
|
|
|
return HookActionContinue, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (h *NilHook) PostPlanImport(addr addrs.AbsResourceInstance, imported []providers.ImportedResource) (HookAction, error) {
|
|
|
|
|
return HookActionContinue, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (h *NilHook) PreApplyImport(addr addrs.AbsResourceInstance, importing plans.ImportingSrc) (HookAction, error) {
|
|
|
|
|
return HookActionContinue, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (h *NilHook) PostApplyImport(addr addrs.AbsResourceInstance, importing plans.ImportingSrc) (HookAction, error) {
|
|
|
|
|
return HookActionContinue, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (*NilHook) Stopping() {
|
|
|
|
|
// Does nothing at all by default
|
|
|
|
|
}
|
|
|
|
|
|