Stop using the phrase "terrorist attack" to mean "unspeakable evil that can never ever be justified by anyone for anything and can never be questioned and must be responded to with all possible violence means necessary".
Terrorism is an act of political resistance, by definition. It is any violence used to inspire fear and bring about political change.
The political change being sought is the end to slow genocide, the end to apartheid, the end to violent displacement, the end to violent neglect, the end to subjugation. When analyzing the situation, the decision was made by the resistance fighters that this action would lead to political change, and so far that possibility is still there.
Israel's response should have been ages ago. It has no legitimacy anymore. It exists purely through violent domination. There is no way for Israel to respond correctly except to begin the political process of dissolving itself and ceding power to the Palestinians. They won't do this, so literally anything else is just going to be a continuation of the last 80 years of violent oppression. There's no way for Israel to act correctly because it hasn't been acting correctly for decades and responding to this attack isn't going to change that.
What might change it is their military being bested by the resistance, their missile defense shield being shown to not protect anyone, fear on the part of settlers causing them to abandon settlements, and internal rebellion demanding justice and ending the illegal occupation.