Applying version control and code flows for your IaC
When it comes to IaC, there are many patterns you can leverage. We will review the two most important ones and review the pros and cons of each.
Single pipeline approach
The first approach is to put all the steps to deploy the infrastructure and code in the same pipeline. This has some benefits, such as making sure the environments and code are compatible by testing the IaC before deployment, which gives you great confidence in the result.
However, this has some drawbacks, including the fact that every time there is a code change or a change in the environment, all the steps will run, which makes every run longer than it should be. This also means that pull request validations will take longer, so you might feel a little slowness in your developers getting tasks done.
Separate pipelines for code and infrastructure
A much better approach is to have separate pipelines for code and infrastructure. This means that code...