The double world champion has the full approval and support of McLaren and engine partner Honda, who are having a difficult season in Formula 1.
Alonso, 35, will race for the Honda-powered Andretti team on 28 May, and the car will be branded a McLaren.
McLaren are yet to decide who will replace him in Monaco that weekend, but Jenson Button is a possibility.
Alonso said he had long held an ambition to win the so-called 'triple crown' of Monaco, the Indy 500 and Le Mans.
Only one man has won all three in his career - the late Graham Hill in the 1960s.
Alonso, who won the Monaco Grand Prix in 2006 and 2007, said: "It's a tough challenge, but I'm up for it.
"I don't know when I'm going to race at Le Mans, but one day I intend to. I'm only 35. I've got plenty of time for that."
The Spaniard added he would definitely race for McLaren for the rest of the season, dismissing speculation he could quit part way through the year because of the Honda F1 engine's poor performance.
"It's of course a regret that I won't be able to race at Monaco this year," he said. "But Monaco will be the only 2017 grand prix I'll be missing, and I'll be back in the cockpit for the Canadian Grand Prix in Montreal in early June.
"I've never raced an IndyCar car before, and neither have I ever driven on a super-speedway, but I'm confident I'll get to grips with it fast.