code: func (rs *Resource) DeepCopy() *Resource {
  	if rs == nil {
  		return nil
  	}
  
  	instances := make(map[addrs.InstanceKey]*ResourceInstance, len(rs.Instances))
  	for k, i := range rs.Instances {
  		instances[k] = i.DeepCopy()
  	}
  
  	return &Resource{
  		Addr:           rs.Addr,
  		EachMode:       rs.EachMode,
  		Instances:      instances,
  		ProviderConfig: rs.ProviderConfig, // technically mutable, but immutable by convention
  	}
  }
docs: // DeepCopy returns a new resource state that contains equivalent data to the
  // receiver but shares no backing memory in common.
  //
  // As with all methods on Resource, this method is not safe to use concurrently
  // with writing to any portion of the recieving data structure. It is the
  // caller's responsibility to ensure mutual exclusion for the duration of the
  // operation, but may then freely modify the receiver and the returned copy
  // independently once this method returns.