Question 426 of 519
Read, generate and modify configurationmediumMultiple SelectObjective-mapped

Quick Answer

The correct answer is that provisioners can be used with the 'null_resource' to run arbitrary actions, and they are considered a last resort in Terraform configurations. This is because Terraform provisioners introduce procedural logic that breaks the declarative, idempotent model Terraform is built upon, often leading to state drift or hard-to-debug failures. On the HashiCorp Terraform Associate TF-003 exam, this concept tests your understanding of when to break the declarative paradigm—specifically, that provisioners should only be used when no native resource, data source, or provider feature can achieve the desired outcome. A common trap is thinking provisioners are a standard tool for configuration management, when in fact they are explicitly documented as a fallback. Memory tip: think of provisioners as the “emergency exit” of Terraform—use them only when every other declarative door is locked.

TF-003 Read, generate and modify configuration Practice Question

This TF-003 practice question tests your understanding of read, generate and modify configuration. The scenario asks you to isolate a root cause — eliminate options that address a different problem before choosing. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

Which TWO statements about Terraform provisioners are correct?

Question 1mediummulti select
Full question →

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

Provisioners should be used as a last resort when no other Terraform resource or data source fits.

Option B is correct because Terraform provisioners are considered a last resort for tasks that cannot be accomplished with Terraform's declarative resource model. The official Terraform documentation explicitly states that provisioners should be used sparingly, as they introduce procedural logic and can cause state drift or failures that are hard to debug. This aligns with the principle of keeping configurations idempotent and relying on native resource attributes or data sources first.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Answer analysis

Option-by-option breakdown

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

  • Provisioners can only be used with the 'local-exec' and 'remote-exec' provisioners.

    Why it's wrong here

    There are also 'file' and 'chef' provisioners.

  • Provisioners should be used as a last resort when no other Terraform resource or data source fits.

    Why this is correct

    Best practice: use provisioners only when necessary.

    Related concept

    Read the scenario before looking for a memorised answer.

  • Provisioners are the primary way to configure resources after creation.

    Why it's wrong here

    Terraform is declarative; provisioners are a last resort.

  • Provisioners run only once during initial creation by default.

    Why it's wrong here

    They run on every apply unless 'when = destroy' or 'on_failure = continue'.

  • Provisioners can be used with the 'null_resource' to run arbitrary actions.

    Why this is correct

    'null_resource' is often used with provisioners for side effects.

    Related concept

    Read the scenario before looking for a memorised answer.

Common exam traps

Common exam trap: answer the scenario, not the keyword

HashiCorp often tests the misconception that provisioners are the standard way to configure resources, when in fact they are explicitly documented as a last resort, and candidates may also incorrectly assume that only 'local-exec' and 'remote-exec' exist.

Detailed technical explanation

How to think about this question

Under the hood, provisioners execute commands on the target resource after it is created, but they are not tracked in the Terraform state for idempotency — if a provisioner fails, Terraform marks the resource as tainted and may recreate it on the next apply. A real-world scenario is using a 'null_resource' with a 'local-exec' provisioner to run a script that updates a DNS record via an API, which cannot be expressed as a Terraform resource; however, this pattern should be avoided in favor of dedicated providers like 'dns' or 'aws_route53_record'. The 'null_resource' is a special resource that has no actual infrastructure side effect, making it a common but often misused workaround.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

A small business has 20 workstations on the 192.168.1.0/24 network and one public IP from its ISP. The router uses PAT (NAT overload) so all 20 devices share one public address using different source ports. NAT questions test whether you understand the four address terms and which direction each translation applies.

What to study next

Got this wrong? Here's your next step.

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Related practice questions

Related TF-003 practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free TF-003 practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this TF-003 question test?

Read, generate and modify configuration — This question tests Read, generate and modify configuration — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: Provisioners should be used as a last resort when no other Terraform resource or data source fits. — Option B is correct because Terraform provisioners are considered a last resort for tasks that cannot be accomplished with Terraform's declarative resource model. The official Terraform documentation explicitly states that provisioners should be used sparingly, as they introduce procedural logic and can cause state drift or failures that are hard to debug. This aligns with the principle of keeping configurations idempotent and relying on native resource attributes or data sources first.

What should I do if I get this TF-003 question wrong?

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Last reviewed: Jun 30, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This TF-003 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-003 exam.