diff --git a/terraform/context_plan_test.go b/terraform/context_plan_test.go index 61864fb5d..240fd24dd 100644 --- a/terraform/context_plan_test.go +++ b/terraform/context_plan_test.go @@ -604,7 +604,7 @@ func TestContext2Plan_preventDestroy_bad(t *testing.T) { plan, err := ctx.Plan() - expectedErr := "aws_instance.foo: plan would destroy" + expectedErr := "aws_instance.foo: the plan would destroy" if !strings.Contains(fmt.Sprintf("%s", err), expectedErr) { t.Fatalf("expected err would contain %q\nerr: %s\nplan: %s", expectedErr, err, plan) diff --git a/terraform/eval_check_prevent_destroy.go b/terraform/eval_check_prevent_destroy.go index 7cab76d10..ae9dc4f82 100644 --- a/terraform/eval_check_prevent_destroy.go +++ b/terraform/eval_check_prevent_destroy.go @@ -29,4 +29,4 @@ func (n *EvalCheckPreventDestroy) Eval(ctx EvalContext) (interface{}, error) { return nil, nil } -const preventDestroyErrStr = `%s: plan would destroy, but resource has prevent_destroy set. To avoid this error, either disable prevent_destroy, or change your config so the plan does not destroy this resource.` +const preventDestroyErrStr = `%s: the plan would destroy this resource, but it currently has lifecycle.prevent_destroy set to true. To avoid this error and continue with the plan, either disable lifecycle.prevent_destroy or adjust the scope of the plan using the -target flag.`