code: func requiresReplacePath(k string, ty cty.Type) (cty.Path, error) {
  	if k == "" {
  		return nil, nil
  	}
  	if !ty.IsObjectType() {
  		panic(fmt.Sprintf("requires replace path on non-object type: %#v", ty))
  	}
  
  	path, err := pathFromFlatmapKeyObject(k, ty.AttributeTypes())
  	if err != nil {
  		return path, fmt.Errorf("[%s] %s", k, err)
  	}
  	return path, nil
  }
docs: // requiresReplacePath takes a key from a flatmap along with the cty.Type
  // describing the structure, and returns the cty.Path that would be used to
  // reference the nested value in the data structure.
  // This is used specifically to record the RequiresReplace attributes from a
  // ResourceInstanceDiff.