The former Barcelona boss will replace Jupp Heynckes at the Allianz Arena when he retires at the end of the campaign.
"Pep Guardiola has been the best coach of the last four or five years. All over the club, and in the dressing room too, you sense huge anticipation," Lahm told the club's official website.
"It's a top transfer, a best-in-class solution. Respect for what our bosses have done. You're never guaranteed to bring in a really successful coach like this.
"It shows the club's good image, the quality in the team, and what our current coach has achieved. He has shaped a team who are contenders in all competitions."
Bayern are currently nine points clear at the top of the Bundesliga.