Practice Exams:

HashiCorp Terraform Associate 004 Dumps

EXAM: HashiCorp Certified: Terraform Associate (004)
Verified By Experts
Premium Bundle
$40.00
$59.97 $99.97

Terraform Associate 004 Premium Bundle


  • Premium File 167 Questions & Answers
  • Training Course 118 Lectures
  • Study Guide 285 Pages

HashiCorp Terraform Associate 004 Practice Test 2

Question 10

A university lab wants new assistants to reproduce the same test network without copying the last administrator's interactive shell history. Which combined implementation and verification plan is the best match for this workload?

  1. Implement: Write versioned Terraform resource blocks describing required cloud objects, and use a plan to reconcile actual infrastructure toward that desired state. Verify: Apply the same configuration twice in a sandbox and confirm the second plan contains no infrastructure changes when remote state has not drifted.
  2. Implement: Compose supported providers for public cloud infrastructure and a private virtualization or DNS system, keeping credentials, state and dependencies explicit. Verify: Plan a disposable public subnet and a private DNS record, then verify each change is attributed to the correct configured provider and account.
  3. Implement: Model durable network and compute objects with Terraform configuration while keeping application startup commands in appropriate software deployment tools. Verify: Change a disposable resource property, run terraform plan, and verify the proposed update matches the declared value without recreating unaffected resources.
  4. Implement: Write versioned Terraform resource blocks describing required cloud objects, and use a plan to reconcile actual infrastructure toward that desired state. Verify: Change a disposable resource property, run terraform plan, and verify the proposed update matches the declared value without recreating unaffected resources.

Answer & Explanations

Correct answer: D

A.

The question is set in this situation: A university lab wants new assistants to reproduce the same test network without copying the last administrator's interactive shell history. The action is applicable: Write versioned Terraform resource blocks describing required cloud objects, and use a plan to reconcile actual infrastructure toward that desired state. But its proposed test—Apply the same configuration twice in a sandbox and confirm the second plan contains no infrastructure changes when remote state has not drifted.—addresses “Separate Terraform's configuration from a runtime script for repeatable changes”. This requirement is confirmed instead by: Change a disposable resource property, run terraform plan, and verify the proposed update matches the declared value without recreating unaffected resources.

B.

This action/test pair addresses “Manage hybrid infrastructure while respecting provider ownership”. Compose supported providers for public cloud infrastructure and a private virtualization or DNS system, keeping credentials, state and dependencies explicit. Plan a disposable public subnet and a private DNS record, then verify each change is attributed to the correct configured provider and account. The case instead calls for: Write versioned Terraform resource blocks describing required cloud objects, and use a plan to reconcile actual infrastructure toward that desired state.

C.

The question is set in this situation: A university lab wants new assistants to reproduce the same test network without copying the last administrator's interactive shell history. The test would be relevant: Change a disposable resource property, run terraform plan, and verify the proposed update matches the declared value without recreating unaffected resources. But the offered implementation—Model durable network and compute objects with Terraform configuration while keeping application startup commands in appropriate software deployment tools.—addresses “Separate Terraform's configuration from a runtime script for repeatable changes”. The action needed here is: Write versioned Terraform resource blocks describing required cloud objects, and use a plan to reconcile actual infrastructure toward that desired state.

D.

The question is set in this situation: A university lab wants new assistants to reproduce the same test network without copying the last administrator's interactive shell history. Write versioned Terraform resource blocks describing required cloud objects, and use a plan to reconcile actual infrastructure toward that desired state. Confirm it through this test: Change a disposable resource property, run terraform plan, and verify the proposed update matches the declared value without recreating unaffected resources. Terraform compares configuration, state and observed remote objects to propose changes; ordinary shell provisioning steps instead describe imperative commands without an equivalent state graph.

Question 11

A hospital research team needs identical test networks each term and currently runs an increasingly long bash script on every new instance. Which HashiCorp Terraform infrastructure implementation best satisfies this requirement?

  1. Write versioned Terraform resource blocks describing required cloud objects, and use a plan to reconcile actual infrastructure toward that desired state.
  2. Model durable network and compute objects with Terraform configuration while keeping application startup commands in appropriate software deployment tools.
  3. Declare resource configurations through appropriate provider plugins for each cloud while keeping shared orchestration in Terraform and cloud-specific arguments explicit.
  4. Compose supported providers for public cloud infrastructure and a private virtualization or DNS system, keeping credentials, state and dependencies explicit.

Answer & Explanations

Correct answer: B

A.

Write versioned Terraform resource blocks describing required cloud objects, and use a plan to reconcile actual infrastructure toward that desired state. This addresses “Use declarative configuration to describe desired infrastructure”, where the governing principle is: Terraform compares configuration, state and observed remote objects to propose changes; ordinary shell provisioning steps instead describe imperative commands without an equivalent state graph. The stated case instead calls for: Model durable network and compute objects with Terraform configuration while keeping application startup commands in appropriate software deployment tools.

B.

Model durable network and compute objects with Terraform configuration while keeping application startup commands in appropriate software deployment tools. Terraform manages declared infrastructure lifecycle through provider APIs; running a provisioning shell script on every apply is not inherently a convergent description of an object. Verify the result with this test: Apply the same configuration twice in a sandbox and confirm the second plan contains no infrastructure changes when remote state has not drifted.

C.

Declare resource configurations through appropriate provider plugins for each cloud while keeping shared orchestration in Terraform and cloud-specific arguments explicit. This addresses “Model different clouds using providers without assuming identical resources”, where the governing principle is: Terraform uses provider-specific resource schemas behind a common configuration and workflow; a single language does not make unrelated cloud APIs interchangeable. The stated case instead calls for: Model durable network and compute objects with Terraform configuration while keeping application startup commands in appropriate software deployment tools.

D.

Compose supported providers for public cloud infrastructure and a private virtualization or DNS system, keeping credentials, state and dependencies explicit. This addresses “Manage hybrid infrastructure while respecting provider ownership”, where the governing principle is: A Terraform working directory can coordinate plugins for remote systems with different endpoints, but only resources supported by each provider can be managed through its API. The stated case instead calls for: Model durable network and compute objects with Terraform configuration while keeping application startup commands in appropriate software deployment tools.

Question 12

A hospital research team needs identical test networks each term and currently runs an increasingly long bash script on every new instance. The infrastructure engineer proposes this change: Model durable network and compute objects with Terraform configuration while keeping application startup commands in appropriate software deployment tools. Which mechanism explains why it works?

  1. Terraform manages declared infrastructure lifecycle through provider APIs; running a provisioning shell script on every apply is not inherently a convergent description of an object.
  2. Terraform uses provider-specific resource schemas behind a common configuration and workflow; a single language does not make unrelated cloud APIs interchangeable.
  3. A Terraform working directory can coordinate plugins for remote systems with different endpoints, but only resources supported by each provider can be managed through its API.
  4. Terraform compares configuration, state and observed remote objects to propose changes; ordinary shell provisioning steps instead describe imperative commands without an equivalent state graph.

Answer & Explanations

Correct answer: A

A.

Terraform manages declared infrastructure lifecycle through provider APIs; running a provisioning shell script on every apply is not inherently a convergent description of an object. The corresponding implementation is: Model durable network and compute objects with Terraform configuration while keeping application startup commands in appropriate software deployment tools.

B.

Terraform uses provider-specific resource schemas behind a common configuration and workflow; a single language does not make unrelated cloud APIs interchangeable. That explains “Model different clouds using providers without assuming identical resources”, not the mechanism behind the described change. The relevant principle is: Terraform manages declared infrastructure lifecycle through provider APIs; running a provisioning shell script on every apply is not inherently a convergent description of an object.

C.

A Terraform working directory can coordinate plugins for remote systems with different endpoints, but only resources supported by each provider can be managed through its API. That explains “Manage hybrid infrastructure while respecting provider ownership”, not the mechanism behind the described change. The relevant principle is: Terraform manages declared infrastructure lifecycle through provider APIs; running a provisioning shell script on every apply is not inherently a convergent description of an object.

D.

Terraform compares configuration, state and observed remote objects to propose changes; ordinary shell provisioning steps instead describe imperative commands without an equivalent state graph. That explains “Use declarative configuration to describe desired infrastructure”, not the mechanism behind the described change. The relevant principle is: Terraform manages declared infrastructure lifecycle through provider APIs; running a provisioning shell script on every apply is not inherently a convergent description of an object.

Question 13

A hospital research team needs identical test networks each term and currently runs an increasingly long bash script on every new instance. After implementing this change—Model durable network and compute objects with Terraform configuration while keeping application startup commands in appropriate software deployment tools.—which test most directly validates its intended outcome?

  1. Plan a disposable resource in each of two cloud test accounts and confirm that provider selection, regions and attributes resolve to the intended APIs.
  2. Plan a disposable public subnet and a private DNS record, then verify each change is attributed to the correct configured provider and account.
  3. Apply the same configuration twice in a sandbox and confirm the second plan contains no infrastructure changes when remote state has not drifted.
  4. Change a disposable resource property, run terraform plan, and verify the proposed update matches the declared value without recreating unaffected resources.

Answer & Explanations

Correct answer: C

A.

Plan a disposable resource in each of two cloud test accounts and confirm that provider selection, regions and attributes resolve to the intended APIs. That would help test “Model different clouds using providers without assuming identical resources”, not the outcome required in this scenario. The relevant acceptance check is: Apply the same configuration twice in a sandbox and confirm the second plan contains no infrastructure changes when remote state has not drifted.

B.

Plan a disposable public subnet and a private DNS record, then verify each change is attributed to the correct configured provider and account. That would help test “Manage hybrid infrastructure while respecting provider ownership”, not the outcome required in this scenario. The relevant acceptance check is: Apply the same configuration twice in a sandbox and confirm the second plan contains no infrastructure changes when remote state has not drifted.

C.

Apply the same configuration twice in a sandbox and confirm the second plan contains no infrastructure changes when remote state has not drifted. This check is decisive because terraform manages declared infrastructure lifecycle through provider APIs; running a provisioning shell script on every apply is not inherently a convergent description of an object.

D.

Change a disposable resource property, run terraform plan, and verify the proposed update matches the declared value without recreating unaffected resources. That would help test “Use declarative configuration to describe desired infrastructure”, not the outcome required in this scenario. The relevant acceptance check is: Apply the same configuration twice in a sandbox and confirm the second plan contains no infrastructure changes when remote state has not drifted.

Question 14

A hospital research team needs identical test networks each term and currently runs an increasingly long bash script on every new instance. Which proposed shortcut most directly risks untracked side effects and configuration drift hidden behind a seemingly successful apply and should therefore be rejected?

  1. Run a large mutable bootstrap script during every apply and assume repeated script side effects are harmless and represented in Terraform state.
  2. Assume a resource type named for one provider works unchanged in another cloud without declaring or adapting that provider's schema.
  3. Write one-off console commands on each engineer's laptop and claim the resulting environment is reproducible from a declarative source.
  4. Assume Terraform automatically discovers and manages every on-premises device without installing a provider or declaring any resource.

Answer & Explanations

Correct answer: A

A.

Run a large mutable bootstrap script during every apply and assume repeated script side effects are harmless and represented in Terraform state. The foreseeable failure is untracked side effects and configuration drift hidden behind a seemingly successful apply. The safer response is: Model durable network and compute objects with Terraform configuration while keeping application startup commands in appropriate software deployment tools.

B.

Assume a resource type named for one provider works unchanged in another cloud without declaring or adapting that provider's schema. That shortcut risks failed multi-cloud deployments caused by conflating common workflow with cloud-specific resource APIs. Here the specific shortcut is: Run a large mutable bootstrap script during every apply and assume repeated script side effects are harmless and represented in Terraform state.

C.

Write one-off console commands on each engineer's laptop and claim the resulting environment is reproducible from a declarative source. That shortcut risks inconsistent environments that cannot be reconstructed from reviewed configuration. Here the specific shortcut is: Run a large mutable bootstrap script during every apply and assume repeated script side effects are harmless and represented in Terraform state.

D.

Assume Terraform automatically discovers and manages every on-premises device without installing a provider or declaring any resource. That shortcut risks silent omissions or incorrect changes across the cloud and private-network boundary. Here the specific shortcut is: Run a large mutable bootstrap script during every apply and assume repeated script side effects are harmless and represented in Terraform state.

Question 15

A hospital research team needs identical test networks each term and currently runs an increasingly long bash script on every new instance. Which combined implementation and verification plan is the best match for this workload?

  1. Implement: Compose supported providers for public cloud infrastructure and a private virtualization or DNS system, keeping credentials, state and dependencies explicit. Verify: Plan a disposable public subnet and a private DNS record, then verify each change is attributed to the correct configured provider and account.
  2. Implement: Write versioned Terraform resource blocks describing required cloud objects, and use a plan to reconcile actual infrastructure toward that desired state. Verify: Apply the same configuration twice in a sandbox and confirm the second plan contains no infrastructure changes when remote state has not drifted.
  3. Implement: Model durable network and compute objects with Terraform configuration while keeping application startup commands in appropriate software deployment tools. Verify: Change a disposable resource property, run terraform plan, and verify the proposed update matches the declared value without recreating unaffected resources.
  4. Implement: Model durable network and compute objects with Terraform configuration while keeping application startup commands in appropriate software deployment tools. Verify: Apply the same configuration twice in a sandbox and confirm the second plan contains no infrastructure changes when remote state has not drifted.

Answer & Explanations

Correct answer: D

A.

This action/test pair addresses “Manage hybrid infrastructure while respecting provider ownership”. Compose supported providers for public cloud infrastructure and a private virtualization or DNS system, keeping credentials, state and dependencies explicit. Plan a disposable public subnet and a private DNS record, then verify each change is attributed to the correct configured provider and account. The case instead calls for: Model durable network and compute objects with Terraform configuration while keeping application startup commands in appropriate software deployment tools.

B.

The test would be relevant: Apply the same configuration twice in a sandbox and confirm the second plan contains no infrastructure changes when remote state has not drifted. But the offered implementation—Write versioned Terraform resource blocks describing required cloud objects, and use a plan to reconcile actual infrastructure toward that desired state.—addresses “Use declarative configuration to describe desired infrastructure”. The action needed here is: Model durable network and compute objects with Terraform configuration while keeping application startup commands in appropriate software deployment tools.

C.

The action is applicable: Model durable network and compute objects with Terraform configuration while keeping application startup commands in appropriate software deployment tools. But its proposed test—Change a disposable resource property, run terraform plan, and verify the proposed update matches the declared value without recreating unaffected resources.—addresses “Use declarative configuration to describe desired infrastructure”. This requirement is confirmed instead by: Apply the same configuration twice in a sandbox and confirm the second plan contains no infrastructure changes when remote state has not drifted.

D.

Model durable network and compute objects with Terraform configuration while keeping application startup commands in appropriate software deployment tools. Confirm it through this test: Apply the same configuration twice in a sandbox and confirm the second plan contains no infrastructure changes when remote state has not drifted. Terraform manages declared infrastructure lifecycle through provider APIs; running a provisioning shell script on every apply is not inherently a convergent description of an object.

Question 16

A small retailer wants repeatable database and subnet creation while keeping one-time data migrations separate from infrastructure definition. Which HashiCorp Terraform infrastructure implementation best satisfies this requirement?

  1. Declare resource configurations through appropriate provider plugins for each cloud while keeping shared orchestration in Terraform and cloud-specific arguments explicit.
  2. Model durable network and compute objects with Terraform configuration while keeping application startup commands in appropriate software deployment tools.
  3. Maintain one reusable configuration pattern with explicit per-environment inputs and run it consistently rather than copying and modifying entire cloud stacks manually.
  4. Write versioned Terraform resource blocks describing required cloud objects, and use a plan to reconcile actual infrastructure toward that desired state.

Answer & Explanations

Correct answer: B

A.

The question is set in this situation: A small retailer wants repeatable database and subnet creation while keeping one-time data migrations separate from infrastructure definition. Declare resource configurations through appropriate provider plugins for each cloud while keeping shared orchestration in Terraform and cloud-specific arguments explicit. This addresses “Model different clouds using providers without assuming identical resources”, where the governing principle is: Terraform uses provider-specific resource schemas behind a common configuration and workflow; a single language does not make unrelated cloud APIs interchangeable. The stated case instead calls for: Model durable network and compute objects with Terraform configuration while keeping application startup commands in appropriate software deployment tools.

B.

The question is set in this situation: A small retailer wants repeatable database and subnet creation while keeping one-time data migrations separate from infrastructure definition. Model durable network and compute objects with Terraform configuration while keeping application startup commands in appropriate software deployment tools. Terraform manages declared infrastructure lifecycle through provider APIs; running a provisioning shell script on every apply is not inherently a convergent description of an object. Verify the result with this test: Apply the same configuration twice in a sandbox and confirm the second plan contains no infrastructure changes when remote state has not drifted.

C.

Maintain one reusable configuration pattern with explicit per-environment inputs and run it consistently rather than copying and modifying entire cloud stacks manually. This addresses “Use repeatable Terraform runs to minimize configuration divergence”, where the governing principle is: A shared configuration and input contract reduce divergent hand-written deployments, while Terraform's plan makes environment differences explicit before execution. The stated case instead calls for: Model durable network and compute objects with Terraform configuration while keeping application startup commands in appropriate software deployment tools.

D.

The question is set in this situation: A small retailer wants repeatable database and subnet creation while keeping one-time data migrations separate from infrastructure definition. Write versioned Terraform resource blocks describing required cloud objects, and use a plan to reconcile actual infrastructure toward that desired state. This addresses “Use declarative configuration to describe desired infrastructure”, where the governing principle is: Terraform compares configuration, state and observed remote objects to propose changes; ordinary shell provisioning steps instead describe imperative commands without an equivalent state graph. The stated case instead calls for: Model durable network and compute objects with Terraform configuration while keeping application startup commands in appropriate software deployment tools.

Question 17

A small retailer wants repeatable database and subnet creation while keeping one-time data migrations separate from infrastructure definition. The infrastructure engineer proposes this change: Model durable network and compute objects with Terraform configuration while keeping application startup commands in appropriate software deployment tools. Which mechanism explains why it works?

  1. Terraform compares configuration, state and observed remote objects to propose changes; ordinary shell provisioning steps instead describe imperative commands without an equivalent state graph.
  2. A shared configuration and input contract reduce divergent hand-written deployments, while Terraform's plan makes environment differences explicit before execution.
  3. Terraform uses provider-specific resource schemas behind a common configuration and workflow; a single language does not make unrelated cloud APIs interchangeable.
  4. Terraform manages declared infrastructure lifecycle through provider APIs; running a provisioning shell script on every apply is not inherently a convergent description of an object.

Answer & Explanations

Correct answer: D

A.

The question is set in this situation: A small retailer wants repeatable database and subnet creation while keeping one-time data migrations separate from infrastructure definition. Terraform compares configuration, state and observed remote objects to propose changes; ordinary shell provisioning steps instead describe imperative commands without an equivalent state graph. That explains “Use declarative configuration to describe desired infrastructure”, not the mechanism behind the described change. The relevant principle is: Terraform manages declared infrastructure lifecycle through provider APIs; running a provisioning shell script on every apply is not inherently a convergent description of an object.

B.

A shared configuration and input contract reduce divergent hand-written deployments, while Terraform's plan makes environment differences explicit before execution. That explains “Use repeatable Terraform runs to minimize configuration divergence”, not the mechanism behind the described change. The relevant principle is: Terraform manages declared infrastructure lifecycle through provider APIs; running a provisioning shell script on every apply is not inherently a convergent description of an object.

C.

The question is set in this situation: A small retailer wants repeatable database and subnet creation while keeping one-time data migrations separate from infrastructure definition. Terraform uses provider-specific resource schemas behind a common configuration and workflow; a single language does not make unrelated cloud APIs interchangeable. That explains “Model different clouds using providers without assuming identical resources”, not the mechanism behind the described change. The relevant principle is: Terraform manages declared infrastructure lifecycle through provider APIs; running a provisioning shell script on every apply is not inherently a convergent description of an object.

D.

The question is set in this situation: A small retailer wants repeatable database and subnet creation while keeping one-time data migrations separate from infrastructure definition. Terraform manages declared infrastructure lifecycle through provider APIs; running a provisioning shell script on every apply is not inherently a convergent description of an object. The corresponding implementation is: Model durable network and compute objects with Terraform configuration while keeping application startup commands in appropriate software deployment tools.

Question 18

A small retailer wants repeatable database and subnet creation while keeping one-time data migrations separate from infrastructure definition. After implementing this change—Model durable network and compute objects with Terraform configuration while keeping application startup commands in appropriate software deployment tools.—which test most directly validates its intended outcome?

  1. Plan a disposable resource in each of two cloud test accounts and confirm that provider selection, regions and attributes resolve to the intended APIs.
  2. Provision two disposable environments from the same module using separate inputs and verify their shared structural attributes match their intended contracts.
  3. Apply the same configuration twice in a sandbox and confirm the second plan contains no infrastructure changes when remote state has not drifted.
  4. Change a disposable resource property, run terraform plan, and verify the proposed update matches the declared value without recreating unaffected resources.

Answer & Explanations

Correct answer: C

A.

The question is set in this situation: A small retailer wants repeatable database and subnet creation while keeping one-time data migrations separate from infrastructure definition. Plan a disposable resource in each of two cloud test accounts and confirm that provider selection, regions and attributes resolve to the intended APIs. That would help test “Model different clouds using providers without assuming identical resources”, not the outcome required in this scenario. The relevant acceptance check is: Apply the same configuration twice in a sandbox and confirm the second plan contains no infrastructure changes when remote state has not drifted.

B.

Provision two disposable environments from the same module using separate inputs and verify their shared structural attributes match their intended contracts. That would help test “Use repeatable Terraform runs to minimize configuration divergence”, not the outcome required in this scenario. The relevant acceptance check is: Apply the same configuration twice in a sandbox and confirm the second plan contains no infrastructure changes when remote state has not drifted.

C.

The question is set in this situation: A small retailer wants repeatable database and subnet creation while keeping one-time data migrations separate from infrastructure definition. Apply the same configuration twice in a sandbox and confirm the second plan contains no infrastructure changes when remote state has not drifted. This check is decisive because terraform manages declared infrastructure lifecycle through provider APIs; running a provisioning shell script on every apply is not inherently a convergent description of an object.

D.

The question is set in this situation: A small retailer wants repeatable database and subnet creation while keeping one-time data migrations separate from infrastructure definition. Change a disposable resource property, run terraform plan, and verify the proposed update matches the declared value without recreating unaffected resources. That would help test “Use declarative configuration to describe desired infrastructure”, not the outcome required in this scenario. The relevant acceptance check is: Apply the same configuration twice in a sandbox and confirm the second plan contains no infrastructure changes when remote state has not drifted.

Question 19

A small retailer wants repeatable database and subnet creation while keeping one-time data migrations separate from infrastructure definition. Which proposed shortcut most directly risks untracked side effects and configuration drift hidden behind a seemingly successful apply and should therefore be rejected?

  1. Run a large mutable bootstrap script during every apply and assume repeated script side effects are harmless and represented in Terraform state.
  2. Assume a resource type named for one provider works unchanged in another cloud without declaring or adapting that provider's schema.
  3. Write one-off console commands on each engineer's laptop and claim the resulting environment is reproducible from a declarative source.
  4. Duplicate hundreds of infrastructure declarations into unrelated directories and patch each differently without any shared module or validation.

Answer & Explanations

Correct answer: A

A.

The question is set in this situation: A small retailer wants repeatable database and subnet creation while keeping one-time data migrations separate from infrastructure definition. Run a large mutable bootstrap script during every apply and assume repeated script side effects are harmless and represented in Terraform state. The foreseeable failure is untracked side effects and configuration drift hidden behind a seemingly successful apply. The safer response is: Model durable network and compute objects with Terraform configuration while keeping application startup commands in appropriate software deployment tools.

B.

The question is set in this situation: A small retailer wants repeatable database and subnet creation while keeping one-time data migrations separate from infrastructure definition. Assume a resource type named for one provider works unchanged in another cloud without declaring or adapting that provider's schema. That shortcut risks failed multi-cloud deployments caused by conflating common workflow with cloud-specific resource APIs. Here the specific shortcut is: Run a large mutable bootstrap script during every apply and assume repeated script side effects are harmless and represented in Terraform state.

C.

The question is set in this situation: A small retailer wants repeatable database and subnet creation while keeping one-time data migrations separate from infrastructure definition. Write one-off console commands on each engineer's laptop and claim the resulting environment is reproducible from a declarative source. That shortcut risks inconsistent environments that cannot be reconstructed from reviewed configuration. Here the specific shortcut is: Run a large mutable bootstrap script during every apply and assume repeated script side effects are harmless and represented in Terraform state.

D.

Duplicate hundreds of infrastructure declarations into unrelated directories and patch each differently without any shared module or validation. That shortcut risks drift between environments and repairs that do not propagate consistently. Here the specific shortcut is: Run a large mutable bootstrap script during every apply and assume repeated script side effects are harmless and represented in Terraform state.

Question 20

A small retailer wants repeatable database and subnet creation while keeping one-time data migrations separate from infrastructure definition. Which combined implementation and verification plan is the best match for this workload?

  1. Implement: Write versioned Terraform resource blocks describing required cloud objects, and use a plan to reconcile actual infrastructure toward that desired state. Verify: Apply the same configuration twice in a sandbox and confirm the second plan contains no infrastructure changes when remote state has not drifted.
  2. Implement: Model durable network and compute objects with Terraform configuration while keeping application startup commands in appropriate software deployment tools. Verify: Apply the same configuration twice in a sandbox and confirm the second plan contains no infrastructure changes when remote state has not drifted.
  3. Implement: Declare resource configurations through appropriate provider plugins for each cloud while keeping shared orchestration in Terraform and cloud-specific arguments explicit. Verify: Plan a disposable resource in each of two cloud test accounts and confirm that provider selection, regions and attributes resolve to the intended APIs.
  4. Implement: Model durable network and compute objects with Terraform configuration while keeping application startup commands in appropriate software deployment tools. Verify: Change a disposable resource property, run terraform plan, and verify the proposed update matches the declared value without recreating unaffected resources.

Answer & Explanations

Correct answer: B

A.

The question is set in this situation: A small retailer wants repeatable database and subnet creation while keeping one-time data migrations separate from infrastructure definition. The test would be relevant: Apply the same configuration twice in a sandbox and confirm the second plan contains no infrastructure changes when remote state has not drifted. But the offered implementation—Write versioned Terraform resource blocks describing required cloud objects, and use a plan to reconcile actual infrastructure toward that desired state.—addresses “Use declarative configuration to describe desired infrastructure”. The action needed here is: Model durable network and compute objects with Terraform configuration while keeping application startup commands in appropriate software deployment tools.

B.

The question is set in this situation: A small retailer wants repeatable database and subnet creation while keeping one-time data migrations separate from infrastructure definition. Model durable network and compute objects with Terraform configuration while keeping application startup commands in appropriate software deployment tools. Confirm it through this test: Apply the same configuration twice in a sandbox and confirm the second plan contains no infrastructure changes when remote state has not drifted. Terraform manages declared infrastructure lifecycle through provider APIs; running a provisioning shell script on every apply is not inherently a convergent description of an object.

C.

This action/test pair addresses “Model different clouds using providers without assuming identical resources”. Declare resource configurations through appropriate provider plugins for each cloud while keeping shared orchestration in Terraform and cloud-specific arguments explicit. Plan a disposable resource in each of two cloud test accounts and confirm that provider selection, regions and attributes resolve to the intended APIs. The case instead calls for: Model durable network and compute objects with Terraform configuration while keeping application startup commands in appropriate software deployment tools.

D.

The question is set in this situation: A small retailer wants repeatable database and subnet creation while keeping one-time data migrations separate from infrastructure definition. The action is applicable: Model durable network and compute objects with Terraform configuration while keeping application startup commands in appropriate software deployment tools. But its proposed test—Change a disposable resource property, run terraform plan, and verify the proposed update matches the declared value without recreating unaffected resources.—addresses “Use declarative configuration to describe desired infrastructure”. This requirement is confirmed instead by: Apply the same configuration twice in a sandbox and confirm the second plan contains no infrastructure changes when remote state has not drifted.

HashiCorp Certified: Terraform Associate (004) (Terraform Associate 004) Practice Tests