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 30

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.

Question 291

A Terraform engineer reports: A module needs the current AMI selected by filters rather than hardcoding a guessed ID. Which action BEST addresses the specific Terraform Associate (004) requirement?

  1. Pass secrets through provider-supported write-only arguments and appropriate Vault or ephemeral sources, checking provider versions and never logging values.
  2. Use lifecycle precondition or postcondition for enforceable resource assertions and check blocks for nonblocking health diagnostics when appropriate.
  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

D:

The case says: A module needs the current AMI selected by filters rather than hardcoding a guessed ID. The directly relevant Terraform response is: Use a provider data source that matches a unique existing remote object and feed its returned attributes into managed resource arguments. This addresses the related failure mode: An ambiguous or missing data-source match can fail planning or target the wrong existing resource. Validate the result by checking: The lookup selects the intended existing object and downstream managed resources reference its identifier. The selection matches this objective, rather than a different Terraform administration task.

Incorrect Answers

A:

Pass secrets through provider-supported write-only arguments and appropriate Vault or ephemeral sources, checking provider versions and never logging values. 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 Read-only data source lookup; that other safeguard alone does not verify it.

B:

Use lifecycle precondition or postcondition for enforceable resource assertions and check blocks for nonblocking health diagnostics when appropriate. This is relevant to Preconditions postconditions and checks (official objective 4g). Its distinct failure risk is that confusing advisory checks with hard validation gates can let an unsafe value pass despite a warning. The present question tests Read-only data source lookup, which this measure alone does not establish.

C:

Use a resource block to manage an object lifecycle and a data block to read information about an existing object without claiming its lifecycle. That addresses Managed resources versus data sources (official objective 4a), specifically the hazard that a data source query alone will not create or delete the referenced infrastructure object. Here the necessary action or evidence is Use a provider data source that matches a unique existing remote object and feed its returned attributes into managed resource arguments, not that separate control.

Question 292

After a reviewed change, the team checks: A module needs the current AMI selected by filters rather than hardcoding a guessed ID. Which evidence MOST directly proves the selected approach is working?

  1. A purposely violated precondition blocks the operation while an independent check reports its observed condition as designed.
  2. The lookup selects the intended existing object and downstream managed resources reference its identifier.
  3. The plan creates only declared managed resources while existing data-source objects are read and remain unmanaged.
  4. An authorized workflow can consume the output while casual CLI display is redacted and backend access remains restricted.

Explanation

Correct Answer

B:

The observed situation is: A module needs the current AMI selected by filters rather than hardcoding a guessed ID. The acceptance evidence is: The lookup selects the intended existing object and downstream managed resources reference its identifier. It verifies the corrective approach (Use a provider data source that matches a unique existing remote object and feed its returned attributes into managed resource arguments.) and controls the risk: An ambiguous or missing data-source match can fail planning or target the wrong existing resource. Checking an unrelated Terraform setting would not prove the stated requirement was met.

Incorrect Answers

A:

A purposely violated precondition blocks the operation while an independent check reports its observed condition as designed. This belongs to Preconditions postconditions and checks (official objective 4g). Its separate risk is that confusing advisory checks with hard validation gates can let an unsafe value pass despite a warning. The question instead tests Read-only data source lookup; that other safeguard alone does not verify it.

C:

The plan creates only declared managed resources while existing data-source objects are read and remain unmanaged. That addresses Managed resources versus data sources (official objective 4a), specifically the hazard that a data source query alone will not create or delete the referenced infrastructure object. Here the necessary action or evidence is The lookup selects the intended existing object and downstream managed resources reference its identifier, not that separate control.

D:

An authorized workflow can consume the output while casual CLI display is redacted and backend access remains restricted. This addresses Outputs and sensitive display control (official objective 4c). The separate hazard is that a sensitive output designation hides normal CLI disclosure but does not guarantee the underlying state contains no secret. It does not by itself satisfy the case-specific requirement for Read-only data source lookup.

Question 293

A configuration review reveals: A cloud resource should attach to an existing VPC selected using unique tags. 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. Pass secrets through provider-supported write-only arguments and appropriate Vault or ephemeral sources, checking provider versions and never logging values.
  3. Use object type constraints for named fields and tuple for fixed-position heterogeneous elements when modeling structured input variables.
  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

D:

The case says: A cloud resource should attach to an existing VPC selected using unique tags. The directly relevant Terraform response is: Use a provider data source that matches a unique existing remote object and feed its returned attributes into managed resource arguments. This addresses the related failure mode: An ambiguous or missing data-source match can fail planning or target the wrong existing resource. Validate the result by checking: The lookup selects the intended existing object and downstream managed resources reference its identifier. The selection matches this objective, rather than a different Terraform administration task.

Incorrect Answers

A:

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 belongs to Managed resources versus data sources (official objective 4a). Its separate risk is that a data source query alone will not create or delete the referenced infrastructure object. The question instead tests Read-only data source lookup; that other safeguard alone does not verify it.

B:

Pass secrets through provider-supported write-only arguments and appropriate Vault or ephemeral sources, checking provider versions and never logging values. This is relevant to Provider write-only arguments and Vault integration (official objective 4h). Its distinct failure risk is that using an ordinary resource argument can persist secrets in state, while unsupported write-only fields cannot be assumed to exist. The present question tests Read-only data source lookup, which this measure alone does not establish.

C:

Use object type constraints for named fields and tuple for fixed-position heterogeneous elements when modeling structured input variables. That addresses Object and tuple structural types (official objective 4d), specifically the hazard that treating a structured object like an untyped string makes required fields and attribute access error-prone. Here the necessary action or evidence is Use a provider data source that matches a unique existing remote object and feed its returned attributes into managed resource arguments, not that separate control.

Question 294

A Terraform governance audit identifies: A cloud resource should attach to an existing VPC selected using unique tags. What risk MOST directly explains why a correction is needed?

  1. A replacement may fail if a globally unique name prevents a second object from existing simultaneously.
  2. An ambiguous or missing data-source match can fail planning or target the wrong existing resource.
  3. Treating a structured object like an untyped string makes required fields and attribute access error-prone.
  4. A data source query alone will not create or delete the referenced infrastructure object.

Explanation

Correct Answer

B:

The reported issue (A cloud resource should attach to an existing VPC selected using unique tags) exposes the risk: An ambiguous or missing data-source match can fail planning or target the wrong existing resource. The corrective action is: Use a provider data source that matches a unique existing remote object and feed its returned attributes into managed resource arguments. Confirm with: The lookup selects the intended existing object and downstream managed resources reference its identifier. The risk is specific to this configuration or operation, not an unrelated Terraform feature.

Incorrect Answers

A:

A replacement may fail if a globally unique name prevents a second object from existing simultaneously. This belongs to Lifecycle create_before_destroy (official objective 4f). Its separate risk is that a replacement may fail if a globally unique name prevents a second object from existing simultaneously. The question instead tests Read-only data source lookup; that other safeguard alone does not verify it.

C:

Treating a structured object like an untyped string makes required fields and attribute access error-prone. That is the exact risk associated with Object and tuple structural types (official objective 4d), not the required Read-only data source lookup outcome.

D:

A data source query alone will not create or delete the referenced infrastructure object. This addresses Managed resources versus data sources (official objective 4a). The separate hazard is that a data source query alone will not create or delete the referenced infrastructure object. It does not by itself satisfy the case-specific requirement for Read-only data source lookup.

Question 295

During a controlled infrastructure change, a team observes: A data lookup returns multiple matches and the team must tighten its filter. Which action BEST addresses the specific Terraform Associate (004) requirement?

  1. Use a variable validation block with a clear condition and error message to reject invalid caller inputs before changes are planned.
  2. Use a provider data source that matches a unique existing remote object and feed its returned attributes into managed resource arguments.
  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 lifecycle create_before_destroy for supported replacements requiring new capacity before old removal, while checking name uniqueness and provider constraints.

Explanation

Correct Answer

B:

The case says: A data lookup returns multiple matches and the team must tighten its filter. The directly relevant Terraform response is: Use a provider data source that matches a unique existing remote object and feed its returned attributes into managed resource arguments. This addresses the related failure mode: An ambiguous or missing data-source match can fail planning or target the wrong existing resource. Validate the result by checking: The lookup selects the intended existing object and downstream managed resources reference its identifier. The selection matches this objective, rather than a different Terraform administration task.

Incorrect Answers

A:

Use a variable validation block with a clear condition and error message to reject invalid caller inputs before changes are planned. This belongs to Input variable validation rules (official objective 4g). Its separate risk is that malformed input values can drive unsupported sizes or unsafe configuration even when their basic types are valid. The question instead tests Read-only data source lookup; that other safeguard alone does not verify it.

C:

Use a resource block to manage an object lifecycle and a data block to read information about an existing object without claiming its lifecycle. That addresses Managed resources versus data sources (official objective 4a), specifically the hazard that a data source query alone will not create or delete the referenced infrastructure object. Here the necessary action or evidence is Use a provider data source that matches a unique existing remote object and feed its returned attributes into managed resource arguments, not that separate control.

D:

Use lifecycle create_before_destroy for supported replacements requiring new capacity before old removal, while checking name uniqueness and provider constraints. This addresses Lifecycle create_before_destroy (official objective 4f). The separate hazard is that a replacement may fail if a globally unique name prevents a second object from existing simultaneously. It does not by itself satisfy the case-specific requirement for Read-only data source lookup.

Question 296

An operator wants proof regarding: A data lookup returns multiple matches and the team must tighten its filter. Which evidence MOST directly proves the selected approach is working?

  1. The plan adds or removes the intended keyed resource without renumbering unrelated instances.
  2. The lookup selects the intended existing object and downstream managed resources reference its identifier.
  3. A purposely violated precondition blocks the operation while an independent check reports its observed condition as designed.
  4. The plan creates only declared managed resources while existing data-source objects are read and remain unmanaged.

Explanation

Correct Answer

B:

The observed situation is: A data lookup returns multiple matches and the team must tighten its filter. The acceptance evidence is: The lookup selects the intended existing object and downstream managed resources reference its identifier. It verifies the corrective approach (Use a provider data source that matches a unique existing remote object and feed its returned attributes into managed resource arguments.) and controls the risk: An ambiguous or missing data-source match can fail planning or target the wrong existing resource. 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 Read-only data source lookup; that other safeguard alone does not verify it.

C:

A purposely violated precondition blocks the operation while an independent check reports its observed condition as designed. That addresses Preconditions postconditions and checks (official objective 4g), specifically the hazard that confusing advisory checks with hard validation gates can let an unsafe value pass despite a warning. Here the necessary action or evidence is The lookup selects the intended existing object and downstream managed resources reference its identifier, not that separate control.

D:

The plan creates only declared managed resources while existing data-source objects are read and remain unmanaged. This addresses Managed resources versus data sources (official objective 4a). The separate hazard is that a data source query alone will not create or delete the referenced infrastructure object. It does not by itself satisfy the case-specific requirement for Read-only data source lookup.

Question 297

An infrastructure deployment design calls for: An administrator queries an external DNS zone without intending to take ownership of it. Which action BEST addresses the specific Terraform Associate (004) requirement?

  1. Use a provider data source that matches a unique existing remote object and feed its returned attributes into managed resource arguments.
  2. Use depends_on only when a real ordering requirement is not represented by an attribute reference, after checking implicit dependencies first.
  3. Use for_each keyed by stable resource identifiers for collections whose entries change independently and count for genuinely index-oriented repetition.
  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

A:

The case says: An administrator queries an external DNS zone without intending to take ownership of it. The directly relevant Terraform response is: Use a provider data source that matches a unique existing remote object and feed its returned attributes into managed resource arguments. This addresses the related failure mode: An ambiguous or missing data-source match can fail planning or target the wrong existing resource. Validate the result by checking: The lookup selects the intended existing object and downstream managed resources reference its identifier. The selection matches this objective, rather than a different Terraform administration task.

Incorrect Answers

B:

Use depends_on only when a real ordering requirement is not represented by an attribute reference, after checking implicit dependencies first. This is relevant to Explicit depends_on for hidden dependencies (official objective 4f). Its distinct failure risk is that terraform may not infer relationships that have no data reference, but excessive explicit dependencies can make plans unnecessarily conservative. The present question tests Read-only data source lookup, which this measure alone does not establish.

C:

Use for_each keyed by stable resource identifiers for collections whose entries change independently and count for genuinely index-oriented repetition. That addresses count versus for_each stable addressing (official objective 4e), specifically the hazard that removing a middle entry from a count-indexed collection can shift addresses and provoke unintended replacements. Here the necessary action or evidence is Use a provider data source that matches a unique existing remote object and feed its returned attributes into managed resource arguments, not that separate control.

D:

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 Managed resources versus data sources (official objective 4a). The separate hazard is that a data source query alone will not create or delete the referenced infrastructure object. It does not by itself satisfy the case-specific requirement for Read-only data source lookup.

Question 298

A production-readiness review highlights: An administrator queries an external DNS zone without intending to take ownership of it. 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 sensitive output designation hides normal CLI disclosure but does not guarantee the underlying state contains no secret.
  3. Using a set where stable indices are required can make addressing and ordering assumptions invalid.
  4. A data source query alone will not create or delete the referenced infrastructure object.

Explanation

Correct Answer

A:

The reported issue (An administrator queries an external DNS zone without intending to take ownership of it) exposes the risk: An ambiguous or missing data-source match can fail planning or target the wrong existing resource. The corrective action is: Use a provider data source that matches a unique existing remote object and feed its returned attributes into managed resource arguments. Confirm with: The lookup selects the intended existing object and downstream managed resources reference its identifier. The risk is specific to this configuration or operation, not an unrelated Terraform feature.

Incorrect Answers

B:

A sensitive output designation hides normal CLI disclosure but does not guarantee the underlying state contains no secret. This is relevant to Outputs and sensitive display control (official objective 4c). Its distinct failure risk is that a sensitive output designation hides normal CLI disclosure but does not guarantee the underlying state contains no secret. The present question tests Read-only data source lookup, which this measure alone does not establish.

C:

Using a set where stable indices are required can make addressing and ordering assumptions invalid. That is the exact risk associated with Terraform list set and map collections (official objective 4d), not the required Read-only data source lookup outcome.

D:

A data source query alone will not create or delete the referenced infrastructure object. This addresses Managed resources versus data sources (official objective 4a). The separate hazard is that a data source query alone will not create or delete the referenced infrastructure object. It does not by itself satisfy the case-specific requirement for Read-only data source lookup.

Question 299

An operations team needs to resolve: A service requires the latest approved image ID during its infrastructure plan. Which action BEST addresses the specific Terraform Associate (004) requirement?

  1. Use a provider data source that matches a unique existing remote object and feed its returned attributes into managed resource arguments.
  2. Use object type constraints for named fields and tuple for fixed-position heterogeneous elements when modeling structured input variables.
  3. Select list when element order and duplicates matter, set for unique unordered values, and map for values indexed by string keys.
  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

A:

The case says: A service requires the latest approved image ID during its infrastructure plan. The directly relevant Terraform response is: Use a provider data source that matches a unique existing remote object and feed its returned attributes into managed resource arguments. This addresses the related failure mode: An ambiguous or missing data-source match can fail planning or target the wrong existing resource. Validate the result by checking: The lookup selects the intended existing object and downstream managed resources reference its identifier. The selection matches this objective, rather than a different Terraform administration task.

Incorrect Answers

B:

Use object type constraints for named fields and tuple for fixed-position heterogeneous elements when modeling structured input variables. This is relevant to Object and tuple structural types (official objective 4d). Its distinct failure risk is that treating a structured object like an untyped string makes required fields and attribute access error-prone. The present question tests Read-only data source lookup, which this measure alone does not establish.

C:

Select list when element order and duplicates matter, set for unique unordered values, and map for values indexed by string keys. That addresses Terraform list set and map collections (official objective 4d), specifically the hazard that using a set where stable indices are required can make addressing and ordering assumptions invalid. Here the necessary action or evidence is Use a provider data source that matches a unique existing remote object and feed its returned attributes into managed resource arguments, not that separate control.

D:

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 Managed resources versus data sources (official objective 4a). The separate hazard is that a data source query alone will not create or delete the referenced infrastructure object. It does not by itself satisfy the case-specific requirement for Read-only data source lookup.

Question 300

A Terraform associate evaluates: A service requires the latest approved image ID during its infrastructure plan. Select TWO complementary responses: the appropriate action AND direct evidence it worked.

  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. A root-level consumer resolves a declared module output and no undeclared child address is referenced.
  3. The lookup selects the intended existing object and downstream managed resources reference its identifier.
  4. Removing a middle entry from a count-indexed collection can shift addresses and provoke unintended replacements.
  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

C:

The observed situation is: A service requires the latest approved image ID during its infrastructure plan. The acceptance evidence is: The lookup selects the intended existing object and downstream managed resources reference its identifier. It verifies the corrective approach (Use a provider data source that matches a unique existing remote object and feed its returned attributes into managed resource arguments.) and controls the risk: An ambiguous or missing data-source match can fail planning or target the wrong existing resource. Checking an unrelated Terraform setting would not prove the stated requirement was met.

E:

The case says: A service requires the latest approved image ID during its infrastructure plan. The directly relevant Terraform response is: Use a provider data source that matches a unique existing remote object and feed its returned attributes into managed resource arguments. This addresses the related failure mode: An ambiguous or missing data-source match can fail planning or target the wrong existing resource. Validate the result by checking: The lookup selects the intended existing object and downstream managed resources reference its identifier. The selection matches this objective, rather than a different Terraform administration task.

Incorrect Answers

A:

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 belongs to Managed resources versus data sources (official objective 4a). Its separate risk is that a data source query alone will not create or delete the referenced infrastructure object. The question instead tests Read-only data source lookup; 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 Read-only data source lookup, which this measure alone does not establish.

D:

Removing a middle entry from a count-indexed collection can shift addresses and provoke unintended replacements. This addresses count versus for_each stable addressing (official objective 4e). The separate hazard is that removing a middle entry from a count-indexed collection can shift addresses and provoke unintended replacements. It does not by itself satisfy the case-specific requirement for Read-only data source lookup.