mcAfee Secure Website
23

HashiCorp Terraform Associate 004 Bundle

Exam Code: Terraform Associate 004

Exam Name HashiCorp Certified: Terraform Associate (004)

Certification Provider: HashiCorp

Corresponding Certification: Terraform Associate

Terraform Associate 004 Training Materials $44.99

Reliable & Actual Study Materials for Terraform Associate 004 Exam Success

The Latest Terraform Associate 004 Exam Questions as Experienced in the Actual Test!

  • 24
    Questions & Answers

    Terraform Associate 004 Questions & Answers

    167 Questions & Answers

    Includes questions types found on actual exam such as drag and drop, simulation, type in, and fill in the blank.

  • 25
    Terraform Associate 004 Video Course

    Terraform Associate 004 Training Course

    118 Video Lectures

    Based on Real Life Scenarios which you will encounter in exam and learn by working with real equipment.

  • exam =30
    Study Guide

    Terraform Associate 004 Study Guide

    285 PDF Pages

    Study Guide developed by industry experts who have written exams in the past. They are technology-specific IT certification researchers with at least a decade of experience at Fortune 500 companies.

exam =32

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

Guarantee

Satisfaction Guaranteed

Pass4sure has a remarkable HashiCorp Candidate Success record. We're confident of our products and provide no hassle product exchange. That's how confident we are!

99.3% Pass Rate
Total Cost: $194.97
Bundle Price: $149.98

Purchase Individually

  • exam =34
    Questions & Answers

    Questions & Answers

    167 Questions

    $124.99
    exam =35
  • exam =37
    Terraform Associate 004 Video Course

    Training Course

    118 Video Lectures

    $39.99
  • exam =36
    Study Guide

    Study Guide

    285 PDF Pages

    $29.99

HashiCorp Terraform Associate 004 Practice Test 29

Question 280

A Terraform associate evaluates: A build system needs a deterministic formatting gate before deeper testing. Select TWO complementary responses: the appropriate action AND direct evidence it worked.

  1. A deliberately unformatted file makes the check fail and a formatted file passes without modification.
  2. Use terraform fmt -check (optionally -recursive) to fail CI on noncanonical formatting without changing committed files.
  3. A subsequent validate succeeds with the intended resource names and provider schema.
  4. Running destroy in the wrong selected workspace can remove live resources rather than the intended test stack.
  5. Run terraform fmt to apply canonical HCL layout without assuming it checks provider resource correctness.

Explanation

Correct Answers

A:

The observed situation is: A build system needs a deterministic formatting gate before deeper testing. The acceptance evidence is: A deliberately unformatted file makes the check fail and a formatted file passes without modification. It verifies the corrective approach (Use terraform fmt -check (optionally -recursive) to fail CI on noncanonical formatting without changing committed files.) and controls the risk: Automatically rewriting formatting during a read-only CI check can produce untracked repository changes. Checking an unrelated Terraform setting would not prove the stated requirement was met.

B:

The case says: A build system needs a deterministic formatting gate before deeper testing. The directly relevant Terraform response is: Use terraform fmt -check (optionally -recursive) to fail CI on noncanonical formatting without changing committed files. This addresses the related failure mode: Automatically rewriting formatting during a read-only CI check can produce untracked repository changes. Validate the result by checking: A deliberately unformatted file makes the check fail and a formatted file passes without modification. The selection matches this objective, rather than a different Terraform administration task.

Incorrect Answers

C:

A subsequent validate succeeds with the intended resource names and provider schema. That addresses Detect invalid references and values (official objective 3c), specifically the hazard that a typo in a resource reference or invalid argument can prevent Terraform from constructing a valid graph. Here the necessary action or evidence is the paired action A deliberately unformatted file makes the check fail and a formatted file passes without modification and separate validation Use terraform fmt -check (optionally -recursive) to fail CI on noncanonical formatting without changing committed files, not that separate control.

D:

Running destroy in the wrong selected workspace can remove live resources rather than the intended test stack. This addresses Destroy scope and workspace safety (official objective 3f). The separate hazard is that running destroy in the wrong selected workspace can remove live resources rather than the intended test stack. It does not by itself satisfy the case-specific requirement for Formatting check in CI.

E:

Run terraform fmt to apply canonical HCL layout without assuming it checks provider resource correctness. This does not provide the required Formatting check in CI action-and-evidence pair.

Question 281

A Terraform engineer reports: A service needs to look up an existing network rather than provision a second one. Which action BEST addresses the specific Terraform Associate (004) requirement?

  1. Use a resource block to manage an object lifecycle and a data block to read information about an existing object without claiming its lifecycle.
  2. Use for_each keyed by stable resource identifiers for collections whose entries change independently and count for genuinely index-oriented repetition.
  3. Use a provider data source that matches a unique existing remote object and feed its returned attributes into managed resource arguments.
  4. Use depends_on only when a real ordering requirement is not represented by an attribute reference, after checking implicit dependencies first.

Explanation

Correct Answer

A:

The case says: A service needs to look up an existing network rather than provision a second one. The directly relevant Terraform response is: Use a resource block to manage an object lifecycle and a data block to read information about an existing object without claiming its lifecycle. This addresses the related failure mode: A data source query alone will not create or delete the referenced infrastructure object. Validate the result by checking: The plan creates only declared managed resources while existing data-source objects are read and remain unmanaged. The selection matches this objective, rather than a different Terraform administration task.

Incorrect Answers

B:

Use for_each keyed by stable resource identifiers for collections whose entries change independently and count for genuinely index-oriented repetition. This is relevant to count versus for_each stable addressing (official objective 4e). Its distinct failure risk is that removing a middle entry from a count-indexed collection can shift addresses and provoke unintended replacements. The present question tests Managed resources versus data sources, which this measure alone does not establish.

C:

Use a provider data source that matches a unique existing remote object and feed its returned attributes into managed resource arguments. That addresses Read-only data source lookup (official objective 4a), specifically the hazard that an ambiguous or missing data-source match can fail planning or target the wrong existing resource. Here the necessary action or evidence is Use a resource block to manage an object lifecycle and a data block to read information about an existing object without claiming its lifecycle, not that separate control.

D:

Use depends_on only when a real ordering requirement is not represented by an attribute reference, after checking implicit dependencies first. This addresses Explicit depends_on for hidden dependencies (official objective 4f). The separate hazard is that terraform may not infer relationships that have no data reference, but excessive explicit dependencies can make plans unnecessarily conservative. It does not by itself satisfy the case-specific requirement for Managed resources versus data sources.

Question 282

After a reviewed change, the team checks: A service needs to look up an existing network rather than provision a second one. Which evidence MOST directly proves the selected approach is working?

  1. The lookup selects the intended existing object and downstream managed resources reference its identifier.
  2. A root-level consumer resolves a declared module output and no undeclared child address is referenced.
  3. State and plan inspections confirm approved temporary credentials are omitted and ordinary sensitive outputs are redacted.
  4. The plan creates only declared managed resources while existing data-source objects are read and remain unmanaged.

Explanation

Correct Answer

D:

The observed situation is: A service needs to look up an existing network rather than provision a second one. The acceptance evidence is: The plan creates only declared managed resources while existing data-source objects are read and remain unmanaged. It verifies the corrective approach (Use a resource block to manage an object lifecycle and a data block to read information about an existing object without claiming its lifecycle.) and controls the risk: A data source query alone will not create or delete the referenced infrastructure object. Checking an unrelated Terraform setting would not prove the stated requirement was met.

Incorrect Answers

A:

The lookup selects the intended existing object and downstream managed resources reference its identifier. This belongs to Read-only data source lookup (official objective 4a). Its separate risk is that an ambiguous or missing data-source match can fail planning or target the wrong existing resource. The question instead tests Managed resources versus data sources; that other safeguard alone does not verify it.

B:

A root-level consumer resolves a declared module output and no undeclared child address is referenced. This is relevant to Cross-module output references (official objective 4b). Its distinct failure risk is that trying to reach directly into a child module's private resource address bypasses the module interface. The present question tests Managed resources versus data sources, which this measure alone does not establish.

C:

State and plan inspections confirm approved temporary credentials are omitted and ordinary sensitive outputs are redacted. That addresses Sensitive variables versus ephemeral variables (official objective 4h), specifically the hazard that a secret can still appear in state despite sensitive=true and may require an ephemeral value path to avoid persistence. Here the necessary action or evidence is The plan creates only declared managed resources while existing data-source objects are read and remain unmanaged, not that separate control.

Question 283

A configuration review reveals: An operator declares a data block and expects it to create a database. Which action BEST addresses the specific Terraform Associate (004) requirement?

  1. Use Terraform expressions and built-in functions such as merge, lookup, length and format to compute values reproducibly from configuration inputs.
  2. Use a resource block to manage an object lifecycle and a data block to read information about an existing object without claiming its lifecycle.
  3. Use a provider data source that matches a unique existing remote object and feed its returned attributes into managed resource arguments.
  4. Use a variable validation block with a clear condition and error message to reject invalid caller inputs before changes are planned.

Explanation

Correct Answer

B:

The case says: An operator declares a data block and expects it to create a database. The directly relevant Terraform response is: Use a resource block to manage an object lifecycle and a data block to read information about an existing object without claiming its lifecycle. This addresses the related failure mode: A data source query alone will not create or delete the referenced infrastructure object. Validate the result by checking: The plan creates only declared managed resources while existing data-source objects are read and remain unmanaged. The selection matches this objective, rather than a different Terraform administration task.

Incorrect Answers

A:

Use Terraform expressions and built-in functions such as merge, lookup, length and format to compute values reproducibly from configuration inputs. This belongs to Terraform expressions and built-in functions (official objective 4e). Its separate risk is that manually duplicating derived labels and tags across resources invites inconsistency and errors. The question instead tests Managed resources versus data sources; that other safeguard alone does not verify it.

C:

Use a provider data source that matches a unique existing remote object and feed its returned attributes into managed resource arguments. That addresses Read-only data source lookup (official objective 4a), specifically the hazard that an ambiguous or missing data-source match can fail planning or target the wrong existing resource. Here the necessary action or evidence is Use a resource block to manage an object lifecycle and a data block to read information about an existing object without claiming its lifecycle, not that separate control.

D:

Use a variable validation block with a clear condition and error message to reject invalid caller inputs before changes are planned. This addresses Input variable validation rules (official objective 4g). The separate hazard is that malformed input values can drive unsupported sizes or unsafe configuration even when their basic types are valid. It does not by itself satisfy the case-specific requirement for Managed resources versus data sources.

Question 284

A Terraform governance audit identifies: An operator declares a data block and expects it to create a database. What risk MOST directly explains why a correction is needed?

  1. Trying to reach directly into a child module's private resource address bypasses the module interface.
  2. An ambiguous or missing data-source match can fail planning or target the wrong existing resource.
  3. Manually duplicating derived labels and tags across resources invites inconsistency and errors.
  4. A data source query alone will not create or delete the referenced infrastructure object.

Explanation

Correct Answer

D:

The reported issue (An operator declares a data block and expects it to create a database) exposes the risk: A data source query alone will not create or delete the referenced infrastructure object. The corrective action is: Use a resource block to manage an object lifecycle and a data block to read information about an existing object without claiming its lifecycle. Confirm with: The plan creates only declared managed resources while existing data-source objects are read and remain unmanaged. The risk is specific to this configuration or operation, not an unrelated Terraform feature.

Incorrect Answers

A:

Trying to reach directly into a child module's private resource address bypasses the module interface. This belongs to Cross-module output references (official objective 4b). Its separate risk is that trying to reach directly into a child module's private resource address bypasses the module interface. The question instead tests Managed resources versus data sources; that other safeguard alone does not verify it.

B:

An ambiguous or missing data-source match can fail planning or target the wrong existing resource. This is relevant to Read-only data source lookup (official objective 4a). Its distinct failure risk is that an ambiguous or missing data-source match can fail planning or target the wrong existing resource. The present question tests Managed resources versus data sources, which this measure alone does not establish.

C:

Manually duplicating derived labels and tags across resources invites inconsistency and errors. That is the exact risk associated with Terraform expressions and built-in functions (official objective 4e), not the required Managed resources versus data sources outcome.

Question 285

During a controlled infrastructure change, a team observes: A deployment should create a new VM but read the identifier of an existing shared subnet. Which action BEST addresses the specific Terraform Associate (004) requirement?

  1. Use a resource block to manage an object lifecycle and a data block to read information about an existing object without claiming its lifecycle.
  2. Use sensitive to redact CLI display and ephemeral for supported temporary values that must be omitted from plan and state, respecting context restrictions.
  3. Expose a child module's needed value as an output and reference it from the root through module.NAME.OUTPUT_NAME.
  4. Use a provider data source that matches a unique existing remote object and feed its returned attributes into managed resource arguments.

Explanation

Correct Answer

A:

The case says: A deployment should create a new VM but read the identifier of an existing shared subnet. The directly relevant Terraform response is: Use a resource block to manage an object lifecycle and a data block to read information about an existing object without claiming its lifecycle. This addresses the related failure mode: A data source query alone will not create or delete the referenced infrastructure object. Validate the result by checking: The plan creates only declared managed resources while existing data-source objects are read and remain unmanaged. The selection matches this objective, rather than a different Terraform administration task.

Incorrect Answers

B:

Use sensitive to redact CLI display and ephemeral for supported temporary values that must be omitted from plan and state, respecting context restrictions. This is relevant to Sensitive variables versus ephemeral variables (official objective 4h). Its distinct failure risk is that a secret can still appear in state despite sensitive=true and may require an ephemeral value path to avoid persistence. The present question tests Managed resources versus data sources, which this measure alone does not establish.

C:

Expose a child module's needed value as an output and reference it from the root through module.NAME.OUTPUT_NAME. That addresses Cross-module output references (official objective 4b), specifically the hazard that trying to reach directly into a child module's private resource address bypasses the module interface. Here the necessary action or evidence is Use a resource block to manage an object lifecycle and a data block to read information about an existing object without claiming its lifecycle, not that separate control.

D:

Use a provider data source that matches a unique existing remote object and feed its returned attributes into managed resource arguments. This addresses Read-only data source lookup (official objective 4a). The separate hazard is that an ambiguous or missing data-source match can fail planning or target the wrong existing resource. It does not by itself satisfy the case-specific requirement for Managed resources versus data sources.

Question 286

An operator wants proof regarding: A deployment should create a new VM but read the identifier of an existing shared subnet. Which evidence MOST directly proves the selected approach is working?

  1. A supported write-only argument updates the target without storing the supplied secret in state or plan.
  2. The plan creates only declared managed resources while existing data-source objects are read and remain unmanaged.
  3. State and plan inspections confirm approved temporary credentials are omitted and ordinary sensitive outputs are redacted.
  4. The lookup selects the intended existing object and downstream managed resources reference its identifier.

Explanation

Correct Answer

B:

The observed situation is: A deployment should create a new VM but read the identifier of an existing shared subnet. The acceptance evidence is: The plan creates only declared managed resources while existing data-source objects are read and remain unmanaged. It verifies the corrective approach (Use a resource block to manage an object lifecycle and a data block to read information about an existing object without claiming its lifecycle.) and controls the risk: A data source query alone will not create or delete the referenced infrastructure object. Checking an unrelated Terraform setting would not prove the stated requirement was met.

Incorrect Answers

A:

A supported write-only argument updates the target without storing the supplied secret in state or plan. This belongs to Provider write-only arguments and Vault integration (official objective 4h). Its separate risk is that using an ordinary resource argument can persist secrets in state, while unsupported write-only fields cannot be assumed to exist. The question instead tests Managed resources versus data sources; that other safeguard alone does not verify it.

C:

State and plan inspections confirm approved temporary credentials are omitted and ordinary sensitive outputs are redacted. That addresses Sensitive variables versus ephemeral variables (official objective 4h), specifically the hazard that a secret can still appear in state despite sensitive=true and may require an ephemeral value path to avoid persistence. Here the necessary action or evidence is The plan creates only declared managed resources while existing data-source objects are read and remain unmanaged, not that separate control.

D:

The lookup selects the intended existing object and downstream managed resources reference its identifier. This addresses Read-only data source lookup (official objective 4a). The separate hazard is that an ambiguous or missing data-source match can fail planning or target the wrong existing resource. It does not by itself satisfy the case-specific requirement for Managed resources versus data sources.

Question 287

An infrastructure deployment design calls for: A team must distinguish an object managed by Terraform from one merely queried. Which action BEST addresses the specific Terraform Associate (004) requirement?

  1. Declare outputs for intended consumer values and mark sensitive outputs appropriately while separately protecting any state that may contain them.
  2. Use Terraform expressions and built-in functions such as merge, lookup, length and format to compute values reproducibly from configuration inputs.
  3. Use a resource block to manage an object lifecycle and a data block to read information about an existing object without claiming its lifecycle.
  4. Use a provider data source that matches a unique existing remote object and feed its returned attributes into managed resource arguments.

Explanation

Correct Answer

C:

The case says: A team must distinguish an object managed by Terraform from one merely queried. The directly relevant Terraform response is: Use a resource block to manage an object lifecycle and a data block to read information about an existing object without claiming its lifecycle. This addresses the related failure mode: A data source query alone will not create or delete the referenced infrastructure object. Validate the result by checking: The plan creates only declared managed resources while existing data-source objects are read and remain unmanaged. The selection matches this objective, rather than a different Terraform administration task.

Incorrect Answers

A:

Declare outputs for intended consumer values and mark sensitive outputs appropriately while separately protecting any state that may contain them. This belongs to Outputs and sensitive display control (official objective 4c). Its separate risk is that a sensitive output designation hides normal CLI disclosure but does not guarantee the underlying state contains no secret. The question instead tests Managed resources versus data sources; that other safeguard alone does not verify it.

B:

Use Terraform expressions and built-in functions such as merge, lookup, length and format to compute values reproducibly from configuration inputs. This is relevant to Terraform expressions and built-in functions (official objective 4e). Its distinct failure risk is that manually duplicating derived labels and tags across resources invites inconsistency and errors. The present question tests Managed resources versus data sources, which this measure alone does not establish.

D:

Use a provider data source that matches a unique existing remote object and feed its returned attributes into managed resource arguments. This addresses Read-only data source lookup (official objective 4a). The separate hazard is that an ambiguous or missing data-source match can fail planning or target the wrong existing resource. It does not by itself satisfy the case-specific requirement for Managed resources versus data sources.

Question 288

A production-readiness review highlights: A team must distinguish an object managed by Terraform from one merely queried. What risk MOST directly explains why a correction is needed?

  1. An ambiguous or missing data-source match can fail planning or target the wrong existing resource.
  2. A data source query alone will not create or delete the referenced infrastructure object.
  3. A sensitive output designation hides normal CLI disclosure but does not guarantee the underlying state contains no secret.
  4. Trying to reach directly into a child module's private resource address bypasses the module interface.

Explanation

Correct Answer

B:

The reported issue (A team must distinguish an object managed by Terraform from one merely queried) exposes the risk: A data source query alone will not create or delete the referenced infrastructure object. The corrective action is: Use a resource block to manage an object lifecycle and a data block to read information about an existing object without claiming its lifecycle. Confirm with: The plan creates only declared managed resources while existing data-source objects are read and remain unmanaged. The risk is specific to this configuration or operation, not an unrelated Terraform feature.

Incorrect Answers

A:

An ambiguous or missing data-source match can fail planning or target the wrong existing resource. This belongs to Read-only data source lookup (official objective 4a). Its separate risk is that an ambiguous or missing data-source match can fail planning or target the wrong existing resource. The question instead tests Managed resources versus data sources; that other safeguard alone does not verify it.

C:

A sensitive output designation hides normal CLI disclosure but does not guarantee the underlying state contains no secret. That is the exact risk associated with Outputs and sensitive display control (official objective 4c), not the required Managed resources versus data sources outcome.

D:

Trying to reach directly into a child module's private resource address bypasses the module interface. This addresses Cross-module output references (official objective 4b). The separate hazard is that trying to reach directly into a child module's private resource address bypasses the module interface. It does not by itself satisfy the case-specific requirement for Managed resources versus data sources.

Question 289

An operations team needs to resolve: A developer references a provider data source but cannot see any create action in the plan. Which action BEST addresses the specific Terraform Associate (004) requirement?

  1. Use Terraform expressions and built-in functions such as merge, lookup, length and format to compute values reproducibly from configuration inputs.
  2. Use sensitive to redact CLI display and ephemeral for supported temporary values that must be omitted from plan and state, respecting context restrictions.
  3. Use a provider data source that matches a unique existing remote object and feed its returned attributes into managed resource arguments.
  4. Use a resource block to manage an object lifecycle and a data block to read information about an existing object without claiming its lifecycle.

Explanation

Correct Answer

D:

The case says: A developer references a provider data source but cannot see any create action in the plan. The directly relevant Terraform response is: Use a resource block to manage an object lifecycle and a data block to read information about an existing object without claiming its lifecycle. This addresses the related failure mode: A data source query alone will not create or delete the referenced infrastructure object. Validate the result by checking: The plan creates only declared managed resources while existing data-source objects are read and remain unmanaged. The selection matches this objective, rather than a different Terraform administration task.

Incorrect Answers

A:

Use Terraform expressions and built-in functions such as merge, lookup, length and format to compute values reproducibly from configuration inputs. This belongs to Terraform expressions and built-in functions (official objective 4e). Its separate risk is that manually duplicating derived labels and tags across resources invites inconsistency and errors. The question instead tests Managed resources versus data sources; that other safeguard alone does not verify it.

B:

Use sensitive to redact CLI display and ephemeral for supported temporary values that must be omitted from plan and state, respecting context restrictions. This is relevant to Sensitive variables versus ephemeral variables (official objective 4h). Its distinct failure risk is that a secret can still appear in state despite sensitive=true and may require an ephemeral value path to avoid persistence. The present question tests Managed resources versus data sources, which this measure alone does not establish.

C:

Use a provider data source that matches a unique existing remote object and feed its returned attributes into managed resource arguments. That addresses Read-only data source lookup (official objective 4a), specifically the hazard that an ambiguous or missing data-source match can fail planning or target the wrong existing resource. Here the necessary action or evidence is Use a resource block to manage an object lifecycle and a data block to read information about an existing object without claiming its lifecycle, not that separate control.

Question 290

A Terraform associate evaluates: A developer references a provider data source but cannot see any create action in the plan. Select TWO complementary responses: the appropriate action AND direct evidence it worked.

  1. The plan adds or removes the intended keyed resource without renumbering unrelated instances.
  2. Use a resource block to manage an object lifecycle and a data block to read information about an existing object without claiming its lifecycle.
  3. The plan creates only declared managed resources while existing data-source objects are read and remain unmanaged.
  4. Hardcoded environment values in shared configuration create accidental cross-environment changes.
  5. Use a provider data source that matches a unique existing remote object and feed its returned attributes into managed resource arguments.

Explanation

Correct Answers

B:

The case says: A developer references a provider data source but cannot see any create action in the plan. The directly relevant Terraform response is: Use a resource block to manage an object lifecycle and a data block to read information about an existing object without claiming its lifecycle. This addresses the related failure mode: A data source query alone will not create or delete the referenced infrastructure object. Validate the result by checking: The plan creates only declared managed resources while existing data-source objects are read and remain unmanaged. The selection matches this objective, rather than a different Terraform administration task.

C:

The observed situation is: A developer references a provider data source but cannot see any create action in the plan. The acceptance evidence is: The plan creates only declared managed resources while existing data-source objects are read and remain unmanaged. It verifies the corrective approach (Use a resource block to manage an object lifecycle and a data block to read information about an existing object without claiming its lifecycle.) and controls the risk: A data source query alone will not create or delete the referenced infrastructure object. Checking an unrelated Terraform setting would not prove the stated requirement was met.

Incorrect Answers

A:

The plan adds or removes the intended keyed resource without renumbering unrelated instances. This belongs to count versus for_each stable addressing (official objective 4e). Its separate risk is that removing a middle entry from a count-indexed collection can shift addresses and provoke unintended replacements. The question instead tests Managed resources versus data sources; that other safeguard alone does not verify it.

D:

Hardcoded environment values in shared configuration create accidental cross-environment changes. This addresses Input variables and default or CLI overrides (official objective 4c). The separate hazard is that hardcoded environment values in shared configuration create accidental cross-environment changes. It does not by itself satisfy the case-specific requirement for Managed resources versus data sources.

E:

Use a provider data source that matches a unique existing remote object and feed its returned attributes into managed resource arguments. This does not provide the required Managed resources versus data sources action-and-evidence pair.