When you modify your local Terraform configuration and run terraform plan while a teammate has concurrently modified the infrastructure, the execution plan for terraform apply will be the same.

Prepare for the HashiCorp Terraform Associate Exam with quizzes, flashcards, and multiple-choice questions. Each question includes hints and explanations. Boost your confidence and ace your exam!

Multiple Choice

When you modify your local Terraform configuration and run terraform plan while a teammate has concurrently modified the infrastructure, the execution plan for terraform apply will be the same.

Explanation:
When planning and applying, Terraform bases its decisions on the current state it has. If a teammate changes the real infrastructure while you’re working, the state drifts from what you planned against. When you run apply, Terraform will refresh the state and typically recalculate a new plan to reach the desired configuration, which can yield different changes than the plan you previously saw. Unless you explicitly save a plan file (for example, with -out and then apply that plan), the apply step generates and executes a new plan, so the execution plan is not guaranteed to be the same. To lock in a specific plan, save it and apply that exact plan file.

When planning and applying, Terraform bases its decisions on the current state it has. If a teammate changes the real infrastructure while you’re working, the state drifts from what you planned against. When you run apply, Terraform will refresh the state and typically recalculate a new plan to reach the desired configuration, which can yield different changes than the plan you previously saw. Unless you explicitly save a plan file (for example, with -out and then apply that plan), the apply step generates and executes a new plan, so the execution plan is not guaranteed to be the same. To lock in a specific plan, save it and apply that exact plan file.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy