Simulating infrastructure changes using Terraform
In an earlier recipe, you learned how to manage different environments with Terraform, which is great. But how do we test for changes before applying them?
Terraform has a great internal mechanism that allows us to plan for changes by comparing what our infrastructure code wants and what the remote state includes. That way, we can safely check whether what we thought was a minor modification in our code has in fact a destructive impact (sometimes, some parameters in a resource trigger a full destruction of the resource!).
We'll cover different ways of anticipating, simulating, and targeting changes in our infrastructure, as an added safety check before applying the changes for good.
Getting ready ...
Get Infrastructure as Code (IAC) Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.