|
|
|
|
@ -65,6 +65,7 @@ func (h *UiHook) PreApply(
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
id := n.HumanId()
|
|
|
|
|
addr := n.ResourceAddress()
|
|
|
|
|
|
|
|
|
|
op := uiResourceModify
|
|
|
|
|
if d.Destroy {
|
|
|
|
|
@ -142,7 +143,7 @@ func (h *UiHook) PreApply(
|
|
|
|
|
|
|
|
|
|
h.ui.Output(h.Colorize.Color(fmt.Sprintf(
|
|
|
|
|
"[reset][bold]%s: %s%s[reset]%s",
|
|
|
|
|
id,
|
|
|
|
|
addr,
|
|
|
|
|
operation,
|
|
|
|
|
stateIdSuffix,
|
|
|
|
|
attrString)))
|
|
|
|
|
@ -210,6 +211,7 @@ func (h *UiHook) PostApply(
|
|
|
|
|
applyerr error) (terraform.HookAction, error) {
|
|
|
|
|
|
|
|
|
|
id := n.HumanId()
|
|
|
|
|
addr := n.ResourceAddress()
|
|
|
|
|
|
|
|
|
|
h.l.Lock()
|
|
|
|
|
state := h.resources[id]
|
|
|
|
|
@ -244,7 +246,7 @@ func (h *UiHook) PostApply(
|
|
|
|
|
|
|
|
|
|
colorized := h.Colorize.Color(fmt.Sprintf(
|
|
|
|
|
"[reset][bold]%s: %s after %s%s[reset]",
|
|
|
|
|
id, msg, time.Now().Round(time.Second).Sub(state.Start), stateIdSuffix))
|
|
|
|
|
addr, msg, time.Now().Round(time.Second).Sub(state.Start), stateIdSuffix))
|
|
|
|
|
|
|
|
|
|
h.ui.Output(colorized)
|
|
|
|
|
|
|
|
|
|
@ -260,10 +262,10 @@ func (h *UiHook) PreDiff(
|
|
|
|
|
func (h *UiHook) PreProvision(
|
|
|
|
|
n *terraform.InstanceInfo,
|
|
|
|
|
provId string) (terraform.HookAction, error) {
|
|
|
|
|
id := n.HumanId()
|
|
|
|
|
addr := n.ResourceAddress()
|
|
|
|
|
h.ui.Output(h.Colorize.Color(fmt.Sprintf(
|
|
|
|
|
"[reset][bold]%s: Provisioning with '%s'...[reset]",
|
|
|
|
|
id, provId)))
|
|
|
|
|
addr, provId)))
|
|
|
|
|
return terraform.HookActionContinue, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -271,11 +273,11 @@ func (h *UiHook) ProvisionOutput(
|
|
|
|
|
n *terraform.InstanceInfo,
|
|
|
|
|
provId string,
|
|
|
|
|
msg string) {
|
|
|
|
|
id := n.HumanId()
|
|
|
|
|
addr := n.ResourceAddress()
|
|
|
|
|
var buf bytes.Buffer
|
|
|
|
|
buf.WriteString(h.Colorize.Color("[reset]"))
|
|
|
|
|
|
|
|
|
|
prefix := fmt.Sprintf("%s (%s): ", id, provId)
|
|
|
|
|
prefix := fmt.Sprintf("%s (%s): ", addr, provId)
|
|
|
|
|
s := bufio.NewScanner(strings.NewReader(msg))
|
|
|
|
|
s.Split(scanLines)
|
|
|
|
|
for s.Scan() {
|
|
|
|
|
@ -293,7 +295,7 @@ func (h *UiHook) PreRefresh(
|
|
|
|
|
s *terraform.InstanceState) (terraform.HookAction, error) {
|
|
|
|
|
h.once.Do(h.init)
|
|
|
|
|
|
|
|
|
|
id := n.HumanId()
|
|
|
|
|
addr := n.ResourceAddress()
|
|
|
|
|
|
|
|
|
|
var stateIdSuffix string
|
|
|
|
|
// Data resources refresh before they have ids, whereas managed
|
|
|
|
|
@ -304,7 +306,7 @@ func (h *UiHook) PreRefresh(
|
|
|
|
|
|
|
|
|
|
h.ui.Output(h.Colorize.Color(fmt.Sprintf(
|
|
|
|
|
"[reset][bold]%s: Refreshing state...%s",
|
|
|
|
|
id, stateIdSuffix)))
|
|
|
|
|
addr, stateIdSuffix)))
|
|
|
|
|
return terraform.HookActionContinue, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -313,9 +315,10 @@ func (h *UiHook) PreImportState(
|
|
|
|
|
id string) (terraform.HookAction, error) {
|
|
|
|
|
h.once.Do(h.init)
|
|
|
|
|
|
|
|
|
|
addr := n.ResourceAddress()
|
|
|
|
|
h.ui.Output(h.Colorize.Color(fmt.Sprintf(
|
|
|
|
|
"[reset][bold]%s: Importing from ID %q...",
|
|
|
|
|
n.HumanId(), id)))
|
|
|
|
|
addr, id)))
|
|
|
|
|
return terraform.HookActionContinue, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -324,9 +327,9 @@ func (h *UiHook) PostImportState(
|
|
|
|
|
s []*terraform.InstanceState) (terraform.HookAction, error) {
|
|
|
|
|
h.once.Do(h.init)
|
|
|
|
|
|
|
|
|
|
id := n.HumanId()
|
|
|
|
|
addr := n.ResourceAddress()
|
|
|
|
|
h.ui.Output(h.Colorize.Color(fmt.Sprintf(
|
|
|
|
|
"[reset][bold][green]%s: Import complete!", id)))
|
|
|
|
|
"[reset][bold][green]%s: Import complete!", addr)))
|
|
|
|
|
for _, s := range s {
|
|
|
|
|
h.ui.Output(h.Colorize.Color(fmt.Sprintf(
|
|
|
|
|
"[reset][green] Imported %s (ID: %s)",
|
|
|
|
|
|