1. Initialize
init downloads the providers and modules declared in your config and initializes the backend that stores state.
terraform initTyporithm · easy
Step 1 of 8 · intro card
terraform Commands
init sets up providers and the backend, fmt and validate keep config clean and correct, and plan -out saves the exact changes to apply later.
terraform init is always the first command in a working directory: it downloads the providers and modules your configuration references and initializes the backend that holds state.
fmt rewrites files to canonical style and validate confirms the config is syntactically and internally consistent before you talk to any real infrastructure.
plan computes the diff between your config and the current state; -out=tfplan saves that exact plan so apply executes precisely what you reviewed.
init downloads providers and initializes the backend.
fmt formats, validate checks correctness offline.
plan -out saves the exact plan for apply.
terraform init
terraform fmt
terraform validate
terraform plan -out=tfplanConnect each part of the code to the concept before you type.
init downloads the providers and modules declared in your config and initializes the backend that stores state.
terraform initfmt rewrites .tf files to the canonical HCL style so diffs stay clean.
terraform fmtvalidate checks the configuration for syntax and internal consistency without contacting any provider API.
terraform validateplan -out writes the exact set of changes to a file so apply can replay precisely that plan.
terraform plan -out=tfplanRead the concept map and follow the code breakdown.
Type the implementation, repair mistakes and work through every recall exercise.
Use the final check without hints; revisit weak concepts in short practice sessions.