Courseiva
Understand Terraform's purposeeasyMultiple ChoiceObjective-mapped

TF-004 Understand Terraform's purpose Practice Question

A developer runs `terraform plan` and sees that Terraform will create a new S3 bucket and modify a security group. Which Terraform feature allows the developer to review these changes before applying them?

⚠ Common exam trap

HashiCorp often tests the distinction between `terraform plan` as a read-only preview and `terraform apply` as the execution command, trapping candidates who confuse 'review' with 'apply' or think `terraform validate` performs a dry-run.

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

The `terraform plan` command

The `terraform plan` command creates an execution plan that shows what actions Terraform will take to achieve the desired state defined in the configuration. It compares the current state with the configuration and outputs a diff-like summary of resources to be created, modified, or destroyed, allowing the developer to review changes before applying them with `terraform apply`.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • The `terraform apply` command

    Why it's wrong here

    The `terraform apply` command is used to execute the changes proposed in a plan, provisioning or modifying infrastructure resources in the target cloud or service. It does not generate a preview; instead, it either takes an existing plan file or generates a new plan and then proceeds to make the actual modifications to the remote state and cloud resources. This command is the final step in the provisioning workflow, following a thorough review of the execution plan.

  • The `terraform validate` command

    Why it's wrong here

    The `terraform validate` command primarily checks the configuration files for syntactical correctness and internal consistency, ensuring they adhere to HCL (HashiCorp Configuration Language) rules and provider schema. It verifies that variables are defined, resource arguments are valid, and module calls are correctly structured, but it does not interact with the remote state or cloud provider APIs to determine infrastructure changes.

  • The `terraform plan` command

    Why this is correct

    The `terraform plan` command generates an execution plan, detailing the actions Terraform will take to achieve the desired state defined in the configuration files. This command compares the current infrastructure state (from the state file) with the desired state (from the configuration) and displays a comprehensive preview of resources to be added, changed, or destroyed, without making any actual modifications to the infrastructure.

  • The `terraform state` command

    Why it's wrong here

    The `terraform state` command is a suite of subcommands used for advanced manipulation of the Terraform state file, such as listing resources, moving resources, removing resources, or importing existing infrastructure into management. It directly interacts with the state file to manage the mapping between real-world resources and your configuration, but it does not generate a preview of future infrastructure changes based on configuration differences.

Quick reference

AWS S3 Storage Class Comparison

Storage ClassMin DurationRetrievalUse Case
S3 StandardNoneImmediateFrequently accessed data
S3 Standard-IA30 daysImmediateInfrequent access, rapid retrieval
S3 One Zone-IA30 daysImmediateNon-critical infrequent data
S3 Intelligent-TieringNoneImmediate–hoursUnknown or changing access patterns
S3 Glacier Instant90 daysMillisecondsArchive with instant retrieval
S3 Glacier Flexible90 daysMinutes–hoursArchive, flexible retrieval
S3 Glacier Deep Archive180 daysHoursLong-term compliance archive

About these practice questions

This TF-004 question is part of Courseiva's 428-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

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.