Due to the microservice/nanoservice architecture of the component functions, the code for a Serverless system is very modular. These modular components need to be decoupled from the environments they run on so that they can be deployed on demand. Further, these environments also need to be created, scaled up and out, and disposed of on demand. This dynamic cloud-native nature is impossible to manage by hand. Automation has to be the name of the game.
Infrastructure as Code (IaC) is a technique that is used to model, provision, and manage the infrastructure of cloud systems with code. With automated infrastructure management, human intervention is reduced almost entirely. So, IaC provides speed, security, precision, and most importantly reproducibility while managing environments.
As we saw in Chapter 1, Basics of Serverless, there are multiple tooling options...