code: func (ms *Module) ResourceInstance(addr addrs.ResourceInstance) *ResourceInstance {
  	rs := ms.Resource(addr.Resource)
  	if rs == nil {
  		return nil
  	}
  	return rs.Instance(addr.Key)
  }
docs: // ResourceInstance returns the state for the resource instance with the given
  // address within the receiving module state, or nil if the requested instance
  // is not tracked in the state.