diff --git a/command/state_mv.go b/command/state_mv.go index 818811ddf8..20282382a0 100644 --- a/command/state_mv.go +++ b/command/state_mv.go @@ -184,7 +184,7 @@ func (c *StateMvCommand) Run(args []string) int { diags = diags.Append(tfdiags.Sourceless( tfdiags.Error, msgInvalidTarget, - fmt.Sprintf("Cannot move %s to %s: the target must also be a whole resource.", addrFrom, destAddr), + fmt.Sprintf("Cannot move %s to %s: the source is a whole resource (not a resource instance) so the target must also be a whole resource.", addrFrom, destAddr), )) c.showDiagnostics(diags) return 1 diff --git a/command/state_mv_test.go b/command/state_mv_test.go index 558246b5c9..b9c21e5b76 100644 --- a/command/state_mv_test.go +++ b/command/state_mv_test.go @@ -293,8 +293,9 @@ func TestStateMv_resourceToInstanceErr(t *testing.T) { expectedErr := ` Error: Invalid target address -Cannot move test_instance.foo to test_instance.bar[0]: the target must also be -a whole resource. +Cannot move test_instance.foo to test_instance.bar[0]: the source is a whole +resource (not a resource instance) so the target must also be a whole +resource. ` errOutput := ui.ErrorWriter.String()