Skip to main content
InterviewHubPRO
Section Overview
Q5

Question 5 of 50

Part 1: Terraform Core Architecture, HCL & Providers (1 - 15)

10%
Terraform & IaC (50 Qs)•Part 1: Terraform Core Architecture, HCL & Providers (1 - 15)

Understanding the Execution Lifecycle: `terraform validate` vs. `terraform plan` vs. `terraform apply`.

senior LevelFormsLifecycleCI/CD & DevOps

In Simple Words:

  1. terraform validate: Checks syntax, HCL validity, and internal consistency locally without contacting remote cloud APIs.
  2. terraform plan: Refreshes the state file against cloud APIs, compares current state with configuration files, builds the dependency graph, and prints a preview of planned additions (+), updates (~), and destructions (-).
  3. terraform apply: Executes the planned API calls against cloud providers to provision infrastructure and writes the new state to the state file.