code: func (m *ModuleState) prune() {
  	m.Lock()
  	defer m.Unlock()
  
  	for k, v := range m.Resources {
  		if v == nil || (v.Primary == nil || v.Primary.ID == "") && len(v.Deposed) == 0 {
  			delete(m.Resources, k)
  			continue
  		}
  
  		v.prune()
  	}
  
  	for k, v := range m.Outputs {
  		if v.Value == config.UnknownVariableValue {
  			delete(m.Outputs, k)
  		}
  	}
  
  	m.Dependencies = uniqueStrings(m.Dependencies)
  }
docs: // prune is used to remove any resources that are no longer required