Terraform

What's a typical Terraform workflow?

Difficulty: unrated

Source: bregman-arie/devops-exercises by Arie Bregman

Answer

  1. Write Terraform definitions: .tf files written in HCL that described the desired infrastructure state (and run terraform init at the very beginning)
  2. Review: With command such as terraform plan you can get a glance at what Terraform will perform with the written definitions
  3. Apply definitions: With the command terraform apply Terraform will apply the given definitions, by adding, modifying or removing the resources

This is a manual process. Most of the time this is automated so user submits a PR/MR to propose terraform changes, there is a process to test these changes and once merged they are applied (terraform apply).