It's okay to kill anybody who is trying to kill you. Isn't that literally what you keep telling us you need a gun for?

Make up your mind. Either self defense is a legitimate reason to kill or not. But whether your attacker is wearing a uniform is of no consequence.
By your logic the Warsaw uprising was terrorism too.