core: Check that resource exists in config before evaluating it
core: Check that resource exists in config before evaluating it

We were previously doing this for all of the reference types except this
one. Now we do it for resources and resource instances too, which both
allows us to produce a proper error message when one is missing (rather
than returning an unknown value) and allows us to properly handle the
case where there are no instances yet present in the state (e.g. because
we're in the validate walk) but "count" isn't set, and so a single
unknown value is expected rather than an empty tuple.

hashicorp/terraform-plugin-sdk,hashicorp/terraform-plugin-sdk