code: func (n *NodeAbstractResourceInstance) References() []*addrs.Reference {
  	// If we have a configuration attached then we'll delegate to our
  	// embedded abstract resource, which knows how to extract dependencies
  	// from configuration.
  	if n.Config != nil {
  		if n.Schema == nil {
  			// We'll produce a log message about this out here so that
  			// we can include the full instance address, since the equivalent
  			// message in NodeAbstractResource.References cannot see it.
  			log.Printf("[WARN] no schema is attached to %s, so config references cannot be detected", n.Name())
  			return nil
  		}
  		return n.NodeAbstractResource.References()
  	}
  
  	// Otherwise, if we have state then we'll use the values stored in state
  	// as a fallback.
  	if rs := n.ResourceState; rs != nil {
  		if s := rs.Instance(n.InstanceKey); s != nil {
  			// State is still storing dependencies as old-style strings, so we'll
  			// need to do a little work here to massage this to the form we now
  			// want.
  			var result []*addrs.Reference
  			for _, addr := range s.Current.Dependencies {
  				if addr == nil {
  					// Should never happen; indicates a bug in the state loader
  					panic(fmt.Sprintf("dependencies for current object on %s contains nil address", n.ResourceInstanceAddr()))
  				}
  
  				// This is a little weird: we need to manufacture an addrs.Reference
  				// with a fake range here because the state isn't something we can
  				// make source references into.
  				result = append(result, &addrs.Reference{
  					Subject: addr,
  					SourceRange: tfdiags.SourceRange{
  						Filename: "(state file)",
  					},
  				})
  			}
  			return result
  		}
  	}
  
  	// If we have neither config nor state then we have no references.
  	return nil
  }
docs: // GraphNodeReferencer