diff --git a/addrs/parse_ref.go b/addrs/parse_ref.go index a230d0cd1..4a614102c 100644 --- a/addrs/parse_ref.go +++ b/addrs/parse_ref.go @@ -290,7 +290,7 @@ func parseResourceRef(mode ResourceMode, startRange hcl.Range, traversal hcl.Tra // of the resource, but we don't have enough context here to decide // so we'll let the caller resolve that ambiguity. return &Reference{ - Subject: resourceInstAddr, + Subject: resourceAddr, SourceRange: tfdiags.SourceRangeFromHCL(rng), }, diags } diff --git a/addrs/parse_ref_test.go b/addrs/parse_ref_test.go index f42799f50..792179cef 100644 --- a/addrs/parse_ref_test.go +++ b/addrs/parse_ref_test.go @@ -114,12 +114,10 @@ func TestParseRef(t *testing.T) { { `data.external.foo`, &Reference{ - Subject: ResourceInstance{ - Resource: Resource{ - Mode: DataResourceMode, - Type: "external", - Name: "foo", - }, + Subject: Resource{ + Mode: DataResourceMode, + Type: "external", + Name: "foo", }, SourceRange: tfdiags.SourceRange{ Start: tfdiags.SourcePos{Line: 1, Column: 1, Byte: 0}, @@ -592,12 +590,10 @@ func TestParseRef(t *testing.T) { { `boop_instance.foo`, &Reference{ - Subject: ResourceInstance{ - Resource: Resource{ - Mode: ManagedResourceMode, - Type: "boop_instance", - Name: "foo", - }, + Subject: Resource{ + Mode: ManagedResourceMode, + Type: "boop_instance", + Name: "foo", }, SourceRange: tfdiags.SourceRange{ Start: tfdiags.SourcePos{Line: 1, Column: 1, Byte: 0}, diff --git a/lang/eval.go b/lang/eval.go index 46baef7c0..a2408f150 100644 --- a/lang/eval.go +++ b/lang/eval.go @@ -261,8 +261,6 @@ func (s *Scope) evalContext(refs []*addrs.Reference, selfAddr addrs.Referenceabl // in package addrs. switch subj := rawSubj.(type) { case addrs.Resource: - panic("RESOURCE REFERENCES DON'T HIT THIS") - var into map[string]map[string]cty.Value switch subj.Mode { case addrs.ManagedResourceMode: