What does "terraform plan" do?

  1. Destroys existing infrastructure
  2. Applies changes to infrastructure
  3. Initializes the Terraform working directory
  4. Creates an execution plan showing what actions Terraform will perform ✓

Correct answer: Creates an execution plan showing what actions Terraform will perform

Option D is correct because 'terraform plan' performs a dry run by reading the current state and the desired configuration, then produces a detailed execution plan that lists every resource action (create, update, destroy) Terraform would take, without making any actual changes to infrastructure. Option A is wrong because destroying infrastructure is the purpose of 'terraform destroy', not 'terraform plan'. Option B is wrong because applying changes to infrastructure is the function of 'terraform apply', which requires an explicit confirmation step. Option C is wrong because initializing the Terraform working directory, downloading providers, and setting up the backend is the job of 'terraform init'.

Topic: · terraform plan, execution plan, infrastructure as code, hashicorp terraform

Practice HashiCorp Terraform Associate (003) Questions Free