Automating Terraform Execution in a CI/CD Pipeline
In the previous chapters of this book, we executed all Terraform commands locally in a console with occasional manual user interactions to check the plan provided by Terraform.
In this chapter, we will learn how to run Terraform automatically.
What does it mean to run Terraform automatically?
As we know, in the basic Terraform workflow, there are the apply
and destroy
commands, which ask the user to confirm the application of changes.
However, in a DevOps and automation context, our Terraform configuration should be executed in a CI/CD pipeline that does not require user interaction.
Note: Even if we talk about automation, the step of applying terraform plan
should still require user confirmation. The automation concerns user confirmation during the execution of terraform apply
(or destroy
).
As a reminder, we have already learned one of the ways to automate the execution in Chapter 10, Using Terraform...