diff --git a/plans/objchange/compatible.go b/plans/objchange/compatible.go index d85086c97..8b3aeedbf 100644 --- a/plans/objchange/compatible.go +++ b/plans/objchange/compatible.go @@ -28,12 +28,17 @@ func AssertObjectCompatible(schema *configschema.Block, planned, actual cty.Valu func assertObjectCompatible(schema *configschema.Block, planned, actual cty.Value, path cty.Path) []error { var errs []error + var atRoot string + if len(path) == 0 { + atRoot = "Root resource " + } + if planned.IsNull() && !actual.IsNull() { - errs = append(errs, path.NewErrorf("was absent, but now present")) + errs = append(errs, path.NewErrorf(fmt.Sprintf("%swas absent, but now present", atRoot))) return errs } if actual.IsNull() && !planned.IsNull() { - errs = append(errs, path.NewErrorf("was present, but now absent")) + errs = append(errs, path.NewErrorf(fmt.Sprintf("%swas present, but now absent", atRoot))) return errs } if planned.IsNull() { diff --git a/terraform/eval_apply.go b/terraform/eval_apply.go index 6c9ed41ba..00af310bb 100644 --- a/terraform/eval_apply.go +++ b/terraform/eval_apply.go @@ -245,7 +245,7 @@ func (n *EvalApply) Eval(ctx EvalContext) (interface{}, error) { tfdiags.Error, "Provider produced inconsistent result after apply", fmt.Sprintf( - "When applying changes to %s, provider %q produced an unexpected new value for %s.\n\nThis is a bug in the provider, which should be reported in the provider's own issue tracker.", + "When applying changes to %s, provider %q produced an unexpected new value: %s.\n\nThis is a bug in the provider, which should be reported in the provider's own issue tracker.", absAddr, n.ProviderAddr.Provider.String(), tfdiags.FormatError(err), ), ))