code: func (s *SyncState) SetResourceInstanceDeposed(addr addrs.AbsResourceInstance, key DeposedKey, obj *ResourceInstanceObjectSrc, provider addrs.AbsProviderConfig) {
  	s.lock.Lock()
  	defer s.lock.Unlock()
  
  	ms := s.state.EnsureModule(addr.Module)
  	ms.SetResourceInstanceDeposed(addr.Resource, key, obj.DeepCopy(), provider)
  	s.maybePruneModule(addr.Module)
  }
docs: // SetResourceInstanceDeposed saves the given instance object as a deposed
  // generation of the resource instance with the given address and deposed key.
  //
  // Call this method only for pre-existing deposed objects that already have
  // a known DeposedKey. For example, this method is useful if reloading objects
  // that were persisted to a state file. To mark the current object as deposed,
  // use DeposeResourceInstanceObject instead.
  //
  // The caller must ensure that the given ResourceInstanceObject is not
  // concurrently mutated during this call, but may be freely used again once
  // this function returns.
  //
  // The resource that contains the given instance must already exist in the
  // state, or this method will panic. Use Resource to check first if its
  // presence is not already guaranteed.
  //
  // Any existing current instance object for the given resource and deposed key
  // is overwritten. Set obj to nil to remove the deposed object altogether. If
  // the instance is left with no objects after this operation then it will
  // be removed from its containing resource altogether.
  //
  // If the containing module for this resource or the resource itself are not
  // already tracked in state then they will be added as a side-effect.