code: func (s *State) EnsureModule(addr addrs.ModuleInstance) *Module {
  	ms := s.Module(addr)
  	if ms == nil {
  		ms = NewModule(addr)
  		s.Modules[addr.String()] = ms
  	}
  	return ms
  }
docs: // EnsureModule returns the state for the module with the given address,
  // creating and adding a new one if necessary.
  //
  // Since this might modify the state to add a new instance, it is considered
  // to be a write operation.