Answer:
No, is not a violation of the first law of thermodynamics.
Step-by-step explanation:
The first law of thermodynamics states that energy is neither created nor destroyed in an isolated system (a system without mass or energy transfer with ambient).
In a heat pump work is used to transfer heat from a cold body to a hot body (see figure). In a free system heat would go from the heat source to the cold one, that is why you need work. Work and heat are energy in transit.
W + Qin = Qout
In your case
2 kW + Qin = 7 kW
Qin =5 kW
It would be a violation to the first law of thermodynamics if Qout is less than 2 kW.