TF-004 Understand Terraform's purpose Practice Question
A developer is new to infrastructure as code and wants to deploy a simple web server on AWS using a tool that allows them to define the infrastructure in a reusable and version-controlled manner. They are considering using the AWS Management Console, AWS CLI, or Terraform. Which course of action aligns best with Terraform's purpose?
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Use Terraform to define the web server in a .tf file and run terraform apply.
Terraform is designed for infrastructure as code, allowing declarative configuration, version control, and automation. The console is manual, CLI is imperative and not idempotent. Terraform's purpose is to provision infrastructure as code.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Use Terraform to define the web server in a .tf file and run terraform apply.
Why this is correct
Terraform's declarative configuration, defined in a .tf file, specifies the desired end state of the web server infrastructure. Running terraform apply then intelligently provisions or modifies resources to match this state, ensuring idempotency and providing a consistent, version-controlled blueprint for the environment. This approach automates infrastructure provisioning and updates reliably.
- ✗
Use the AWS Management Console to manually create the web server.
Why it's wrong here
Manually creating a web server via the AWS Management Console directly contradicts the principles of Infrastructure as Code. This method lacks repeatability, auditability, and version control, making it impossible to consistently recreate the environment or track changes over time. It introduces human error and significant operational overhead for managing infrastructure at scale.
- ✗
Write a shell script using the AWS CLI to provision resources.
Why it's wrong here
While AWS CLI scripts can provision resources, they are inherently imperative, requiring explicit steps for creation, modification, and deletion. This approach struggles with state management, idempotency, and error recovery, often leading to inconsistent environments or partial deployments if not meticulously engineered. Terraform's declarative model simplifies these complexities by managing the desired state.
- ✗
Use Terraform but only with local state and no version control.
Why it's wrong here
Using Terraform with only local state and no version control significantly undermines its benefits for collaborative and robust infrastructure management. Local state files are prone to loss and prevent team members from sharing infrastructure context, while the absence of version control eliminates change history, rollback capabilities, and code review processes. These omissions introduce substantial operational risks and hinder team collaboration.
Go deeper
Related to this question
About these practice questions
Courseiva writes every TF-004 question from scratch — 428 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This TF-004 practice question is part of Courseiva's free HashiCorp certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the TF-004 exam.