code: func (ms *Module) DeepCopy() *Module {
  	if ms == nil {
  		return nil
  	}
  
  	resources := make(map[string]*Resource, len(ms.Resources))
  	for k, r := range ms.Resources {
  		resources[k] = r.DeepCopy()
  	}
  	outputValues := make(map[string]*OutputValue, len(ms.OutputValues))
  	for k, v := range ms.OutputValues {
  		outputValues[k] = v.DeepCopy()
  	}
  	localValues := make(map[string]cty.Value, len(ms.LocalValues))
  	for k, v := range ms.LocalValues {
  		// cty.Value is immutable, so we don't need to copy these.
  		localValues[k] = v
  	}
  
  	return &Module{
  		Addr:         ms.Addr, // technically mutable, but immutable by convention
  		Resources:    resources,
  		OutputValues: outputValues,
  		LocalValues:  localValues,
  	}
  }
docs: // DeepCopy returns a new module state that contains equivalent data to the
  // receiver but shares no backing memory in common.
  //
  // As with all methods on Module, 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.