Cisco CCNA (200-301)Automation and ProgrammabilityMedium

An automation engineer runs the following Terraform commands in order while deploying cloud network resources: terraform init terraform plan terraform apply What is the purpose of the 'terraform plan' step?

  1. AIt downloads the required provider plugins for the configuration
  2. BIt permanently destroys all previously created infrastructure
  3. CIt converts the JSON state file into HCL syntax
  4. DIt shows a preview of the changes Terraform will make without applying them
Show answer & explanation

Correct answer: D. It shows a preview of the changes Terraform will make without applying them

'terraform plan' generates an execution plan showing what actions Terraform will take (create, modify, destroy) to reach the desired state defined in the configuration, without actually making any changes, allowing engineers to review before applying.

Why the other options are wrong

  • A. Downloading provider plugins happens during 'terraform init'.
  • B. Destroying infrastructure requires 'terraform destroy', not 'plan'.
  • C. Terraform state files are JSON internally, but 'plan' does not convert syntax.

Terraform Plan

A Terraform command that compares the current state to the desired configuration and displays a preview of additions, changes, and deletions before applying them.

  • Runs after 'terraform init'
  • Does not make actual changes to infrastructure
  • Helps prevent unintended changes before 'terraform apply'

Memory trick: Init, Plan, Apply — map it, check it, build it.

More Automation and Programmability questions