Displaying a summary of the execution of terraform plan
In the previous recipe, we learned how to run Terraform in automation mode. The major difference between the workflows that are running locally and the workflows that are running in a CI/CD pipeline is the automation of the terraform plan
and apply
commands without any user interaction.
However, it can be very interesting (I would even say necessary) to visualize a summary of what will be applied by Terraform.
In this recipe, we will discuss some tips to display the summary of the terraform plan
result inside a CI/CD pipeline.
Let’s get started!
Getting ready
There are no software requirements to complete this recipe.
How to do it…
The first tip to display a short plan summary result is to display if there are some changes or no changes by using the detailed-exit-code
argument of the terraform plan
command by running the following pseudo code:
terraform plan -out=tfplan –detailled...