Infrastructure as Code started off with the commoditization of virtual machines sometime around the mid-2000s.
As with many things in the cloud infra space, Amazon played a key role in making IaC popular. The launch of AWS Cloudformation in 2009 made IaC an essential DevOps practice.