Cook the macaroni in lightly salted boiling water for a few minutes less than it says on the packet.
Drain, put back in the saucepan and add the crème fraiche mixture, along with the ham, tomato sauce and most of the cheese (keep a little of each for sprinkling on top). Taste for seasoning – you might not need salt, but you do need pepper.
Tip into a gratin dish, sprinkle the remaining cheese on top and bake for about 15 minutes until the top is golden.