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. ...

Get Terraform Cookbook - Second Edition 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.