Question 1 · Infrastructure as Code (IaC) with Terraform
A Terraform configuration creates an Azure Virtual Network. An engineer runs terraform apply and the network is created successfully. Two days later, another engineer manually resizes the address space via the Azure portal. When the first engineer runs terraform apply again without changing any configuration files, what is the MOST likely outcome?
Show answer & explanation
Correct answer: B
- B. Terraform will detect the drift between the desired state in the configuration and the actual state in Azure, and will modify the Virtual Network to match the configuration.
Option B is correct: this is Terraform's idempotency in action. On the second apply, Terraform refreshes state, detects that the live resource differs from the desired configuration, and generates a plan to reconcile the drift by updating the address space back to the configured value. Option A is wrong; Terraform does not simply skip existing resources — it compares current state to desired state on every apply. Option C is incorrect; Terraform does not destroy and recreate an entire resource group for a single attribute change unless the specific attribute forces replacement. Option D is false; Terraform handles drift reconciliation automatically and does not redirect users to the console.