"What are these procedures?
As a UN member had the US agreed to follow them, or like the pirate's code, are they more like guidelines?"
According to Robert Manne, the UN Charter ‘prohibits the use of force except in two circumstances: when authorised by the UN Security Council under Chapter VII of the Charter; and in self-defence when an armed attack occurs or is imminent.’ As a founding member, the US would have to have endorsed the charter, so winstoninabox has hit the nail on the head: it is, by definition, wrong to break your promises and be a sneaky lying weasel. Thus the legal prohibition acquires moral force as well, and I must accept that the war was wrong in a slightly less narrow sense. The honourable thing to do would have been to quit the UN before invading, after the failure of all the feverish and probably counterproductive diplomatic activity trying to get UN Security Council authorisation.