Terraform workflow
The Terraform workflow typically consists of the following:
init
: Initializes the Terraform workspace and backend (more on them later) and downloads all required providers. You can run theinit
command multiple times during your build, as it does not change your workspace or state.plan
: It runs a speculative plan on the requested resources. This command typically connects with the cloud provider and then checks whether the objects managed by Terraform exist within the cloud provider and whether they have the same configuration as defined in the Terraform template. It then shows the delta in the plan output that an admin can review and change the configuration if unsatisfied. If satisfied, they can apply the plan to commit the changes to the cloud platform. Theplan
command does not make any changes to the current infrastructure.apply
: This applies the delta configuration to the cloud platform. When you useapply
by itself, it runs theplan
command...