A heater unit includes a heater which is provided inside of a distal end portion of an endoscope insertion portion and which heats the inside to prevent fogging which occurs in an optical member provided the inside, a temperature sensor which measures the temperature of the inside and a flexible substrate. The heater unit further includes an insulating sealing portion which seals a mounting surface of the heater mounted on the flexible substrate, which seals the heater so that so that a joint surface of the heater that faces the mounting surface and that is joined to the lens frame is exposed and which seals the whole temperature sensor.