Search⌘ K
AI Features

Generate and Review Execution Plan for Terraform

Explore how to generate and analyze execution plans using the terraform plan command. Understand its role in validating configuration syntax, refreshing state data, and preparing changes without altering the live environment. This lesson covers arguments like -out and -var that help manage variable inputs and saved plans, equipping you to confidently plan infrastructure updates before applying them.

Purpose of the terraform plan command

The terraform plan command is used to create an execution plan. Terraform performs a syntax validation of the current configuration, a refresh of state based on the actual environment, and, a comparison of the state against the contents of the configuration.

What happens after running the terraform plan command?

Running the terraform plan command doesn’t alter the actual environment. It may alter the state during the refresh process if it finds that a managed resource has changed since the previous refresh. Running terraform plan shows us whether changes are necessary to align the ...