Terraform CLI
⏱ ~3-min readAceMark GuideWhat this topic is really about
The 'terraform fmt' command automatically scans and rewrites configuration files in the current directory to conform to canonical formatting standards. Option A is incorrect because applying infrastructure changes requires 'terraform apply', not 'fmt', which only affects code aesthetics.
Marking a variable as sensitive prevents Terraform from printing its value in CLI output, and injecting it via environment variables or a secret manager avoids exposing secrets in code. Hard-coding sensitive values or storing them in git risks exposing them to unauthorized users.
See the mechanism
Terraform uses provider plugins to translate configuration code into API calls for specific platforms like AWS or GCP. A diagram for this topic isn't available yet — the worked example below walks the same reasoning step by step.
An exam-style question, fully explained
A Terraform provider is:
- Identify what the question tests: A Terraform provider is:.
- Terraform uses provider plugins to translate configuration code into API calls for specific platforms like AWS or GCP.
- In contrast, a storage backend is used to manage and secure the state file, while a CI server is an external automation tool rather than a Terraform component.
Traps the examiner sets
- Option A is incorrect because applying infrastructure changes requires 'terraform apply', not 'fmt', which only affects code aesthetics.
Test your recall
Answer each from memory — you'll see instantly whether you're right and why.
Run a focused 10-question mini-mock on Terraform CLI and see it stick.
Practice more of this topic →