Infrastructure as code (IaC) is an approach that involves managing and provisioning infrastructure resources using version-controlled code, allowing for automation and consistency.