An electronic control unit that controls a rotary electric machine, the electronic control unit comprising: a housing including a wall defining an accommodation space, and a base extending from the wall into the accommodation space; a circuit board disposed on a first surface of the base in the accommodation space; an electrical connection module disposed on a second surface of the base different from the circuit board in the accommodation space and electrically connected to the circuit board; a first connector group electrically connected to the electrical connection module; and a second connector group disposed on the wall and electrically connected to the circuit board, wherein: the first connector group and the second connector group are arranged in a first direction along a side wall of the housing; the base, the electrical connection module, and the circuit board respectively have a first positioning hole, a second positioning hole, and a third positioning hole for positioning relative to each other; a first positioning pin is insertable into an opening of the first positioning hole through the second positioning hole in the first direction; and a second positioning pin is insertable into the other opening of the first positioning hole located on the side opposite to the opening relative to the first positioning hole through the third positioning hole in a second direction which is opposite to the first direction. a housing including a wall defining an accommodation space, and a base extending from the wall into the accommodation space; a circuit board disposed on a first surface of the base in the accommodation space; an electrical connection module disposed on a second surface of the base different from the circuit board in the accommodation space and electrically connected to the circuit board; a first connector group electrically connected to the electrical connection module; and a second connector group disposed on the wall and electrically connected to the circuit board, wherein: the first connector group and the second connector group are arranged in a first direction along a side wall of the housing; the base, the electrical connection module, and the circuit board respectively have a first positioning hole, a second positioning hole, and a third positioning hole for positioning relative to each other; a first positioning pin is insertable into an opening of the first positioning hole through the second positioning hole in the first direction; and a second positioning pin is insertable into the other opening of the first positioning hole located on the side opposite to the opening relative to the first positioning hole through the third positioning hole in a second direction which is opposite to the first direction. the first connector group and the second connector group are arranged in a first direction along a side wall of the housing; the base, the electrical connection module, and the circuit board respectively have a first positioning hole, a second positioning hole, and a third positioning hole for positioning relative to each other; a first positioning pin is insertable into an opening of the first positioning hole through the second positioning hole in the first direction; and a second positioning pin is insertable into the other opening of the first positioning hole located on the side opposite to the opening relative to the first positioning hole through the third positioning hole in a second direction which is opposite to the first direction.