Bring a large pot of salted water to a boil. Add the spaghetti and cook as the label directs. Reserve 1/2 a cup of cooking water, then drain.
Meanwhile, heat the olive oil in a large skillet over medium-high heat. Add the shallot, rosemary, salt, and a few grinds of pepper. Cook, stirring occasionally until the shallot is softened, about 2 minutes.
Reduce the heat to medium and add the wine. Cook, stirring occasionally, until evaporated slightly, about 1 minute.
Add the heavy cream and bring to a boil, stirring occasionally. Continue to cook until the sauce thickens slightly, about 1 minute.
Stir in the Fontina cheese and cook until the sauce is thick and creamy, about 1 minute. Add the prosciutto.
Reduce the heat to low and add the spaghetti to the skillet along with the peas and Parmesan. Stir until well coated, adding the reserved cooking water as needed to loosen.
Notes
If Fontina cheese is unavailable, you can use Gruyère or Gouda cheese instead.