Courseiva
Read, generate and modify configurationeasyMultiple ChoiceObjective-mapped

TF-004 Read, generate and modify configuration Practice Question

An engineer modifies a Terraform configuration by increasing the instance_count for an AWS EC2 resource from 2 to 5. After running terraform plan, which change will be displayed?

⚠ Common exam trap

A common misconception is that increasing `instance_count` triggers an in-place update or partial modification of existing resources, when in fact Terraform treats each index as an independent resource and only creates new ones.

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

Three new resources will be created, two unchanged.

Terraform's `instance_count` meta-argument uses a count-based resource management strategy. When the count increases from 2 to 5, Terraform treats the existing resources (index 0 and 1) as unchanged and plans to create three new resources (indices 2, 3, and 4). No in-place updates or destructions occur because the existing resources' configurations remain identical.

Answer analysis

Option-by-option breakdown

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

  • One new resource will be created and two modified.

    Why it's wrong here

    If the `count` meta-argument was increased (e.g., from 2 to 5), Terraform would plan to create three new resource instances (indices 2, 3, and 4), not just one. Furthermore, existing resources (indices 0 and 1) are typically left unchanged unless their specific attributes, beyond the `count` meta-argument, were also altered. A simple increase in `count` does not trigger modifications to existing instances.

  • Two existing resources will be destroyed and five new created.

    Why it's wrong here

    An increase in the `count` meta-argument does not cause existing resource instances to be destroyed; Terraform intelligently preserves and reuses existing indices. Destruction only occurs when the `count` is *decreased*, or if `for_each` keys are removed. In this scenario, only the *additional* instances needed to meet the new `count` value are created, not a complete replacement of all five.

  • Three new resources will be created, two unchanged.

    Why this is correct

    When the `count` meta-argument for a resource block is increased (e.g., from 2 to 5), Terraform identifies the existing instances (indices 0 and 1) and marks them as unchanged, assuming no other attributes were modified. The plan then indicates the creation of the additional instances required to reach the new total count (indices 2, 3, and 4), resulting in three new resources being created.

  • All five resources will be updated in-place.

    Why it's wrong here

    A change to the `count` meta-argument primarily results in the creation or destruction of resource instances, not in-place updates of existing ones. In-place updates occur when attributes *within* an existing resource block are modified, leading to a change in the configuration of an already provisioned resource. Simply increasing the `count` does not alter the configuration of the previously existing instances.

About these practice questions

One of 428 original TF-004 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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.