Pass HashiCorp Terraform Associate 004 Exam in First Attempt Guaranteed!
Get 100% Latest Exam Questions, Accurate & Verified Answers!
30 Days Free Updates, Instant Download!
HashiCorp Terraform Associate 004 Practice Test 13
Question 120
A controlled cloud model operations assessment for a water utility engineering division concerns field diagnostics and public service. Reviewers find that a configuration builds a service hostname by naive concatenation and omits a separator when environment input is empty. The team proposes to use explicit formatting and conditional expressions with validation of optional pieces. Service owners require a reproducible result without unsafe or unapproved production testing. Which post-change observation would establish the required infrastructure or configuration outcome?
Explanation
Correct Answer
Generated names match required patterns for all allowed inputs. Plan renders an invalid DNS record name even though every individual variable is a string. Use explicit formatting and conditional expressions with validation of optional pieces.
Incorrect Answers
The resolved data object matches the approved owner and no unexpected image resource is provisioned. Plan renders an invalid DNS record name even though every individual variable is a string. Generated names match required patterns for all allowed inputs.
The required policy completes before service startup without introducing unnecessary serial dependencies. Plan renders an invalid DNS record name even though every individual variable is a string. Generated names match required patterns for all allowed inputs.
The configured subnet selection is deterministic and valid across reordered inputs. Plan renders an invalid DNS record name even though every individual variable is a string. Generated names match required patterns for all allowed inputs.
Question 121
For flight and hotel reservation services at a global booking platform, the infrastructure platform team is investigating the following incident: a CI pipeline deletes .terraform.lock.hcl on each run and a previously tested provider unexpectedly changes during redeployment. The proposed remedy is to commit and retain the dependency lock file and initialize without unreviewed provider upgrades. Only a controlled and reversible ML workflow change fits the approved release window. Which finding would best distinguish the suspected cause from nearby Terraform configuration issues?
Explanation
Correct Answer
Build logs show provider selection repeated without the committed checksums and versions. A CI pipeline deletes.terraform.lock.hcl on each run and a previously tested provider unexpectedly changes during redeployment. Multiple clean builds use the same selected provider versions until an explicitly reviewed upgrade.
Incorrect Answers
The working directory has no downloaded plugin and init has not been executed for the current configuration. Build logs show provider selection repeated without the committed checksums and versions.
The state contains the old address while the configuration contains the new address for the same remote resource. Build logs show provider selection repeated without the committed checksums and versions.
Resource identity and provider trace show API calls to the primary account rather than the requested secondary account. Build logs show provider selection repeated without the committed checksums and versions.
Question 122
At a market data company, a change advisory board is reviewing ML input and inference paths for analytics and private data feeds. The reported issue is that a platform decommissions Terraform ownership of a third-party DNS record but must leave the actual record running under another owner. Confirming evidence shows that removing the resource block from configuration causes plan to schedule DNS record deletion. Any change must preserve the approved model contract and show measurable verification evidence. Which implementation paired with its verification outcome addresses the same fault?
Explanation
Correct Answer
Use a supported removed block with destroy=false or controlled state rm after confirming handover. The DNS record remains externally managed and is no longer in this Terraform state's ownership. A platform decommissions Terraform ownership of a third-party DNS record but must leave the actual record running under another owner. Removing state ownership and destroying remote infrastructure are separate operations.
Incorrect Answers
Use a supported removed block with destroy=false or controlled state rm after confirming handover. Authorized workspace reads the original managed identities from the remote backend and local copies are controlled. The intervention addresses the fault, but the proposed test checks a different outcome. The DNS record remains externally managed and is no longer in this Terraform state's ownership.
Use a supported removed block with destroy=false or controlled state rm after confirming handover. A second writer waits or fails safely while a first authorized apply holds the lock. The remedy may be appropriate, but that check does not establish the required recovery. The DNS record remains externally managed and is no longer in this Terraform state's ownership.
Migrate to an approved durable shared backend before repeating managed applies. Separate runs read the same authoritative state and no duplicate resources are proposed. Use a supported removed block with destroy=false or controlled state rm after confirming handover; The DNS record remains externally managed and is no longer in this Terraform state's ownership.
Question 123
During an authorized design and operations review at a food distribution operator, engineers supporting warehouse and supply chain services discover that an organization expects a sibling module to read another module's private values without exposing them through the root. Confirming evidence shows that reference resolution fails because the sibling namespace does not provide that output. Any change must preserve the approved model contract and show measurable verification evidence. Which implementation paired with its verification outcome addresses the same fault?
Explanation
Correct Answer
Expose a minimal root-level mapping and pass the needed value explicitly into the other module. During an authorized design and operations review at a food distribution operator, the necessary identifier flows through declared module interfaces while unrelated state remains private. Reference resolution fails because the sibling namespace does not provide that output. Module dependencies and data exchange are explicit rather than magical shared scopes.
Incorrect Answers
Expose a minimal root-level mapping and pass the needed value explicitly into the other module. The child receives approved values without accessing caller-only locals. The remedy may be appropriate, but that check does not establish the required recovery. The necessary identifier flows through declared module interfaces while unrelated state remains private.
Expose a minimal root-level mapping and pass the needed value explicitly into the other module. The approved module version downloads for entitled workspaces and unauthorized consumers remain blocked. The intervention addresses the fault, but the proposed test checks a different outcome. The necessary identifier flows through declared module interfaces while unrelated state remains private.
Select a reviewed module version range or exact approved version and test upgrade deliberately. The same source resolves to the reviewed module interface across clean deployments. Expose a minimal root-level mapping and pass the needed value explicitly into the other module; The necessary identifier flows through declared module interfaces while unrelated state remains private.
Question 124
At a geospatial analytics startup, a change advisory board is reviewing ML input and inference paths for satellite data ingest and model systems. The reported issue is that a resource needing replacement has a default destroy-before-create behavior and a small production service has no other live replica. The proposed remedy is to use create_before_destroy where the provider and unique naming permit it, with health-checked cutover. The team must preserve approved data handling and avoid widening access to sensitive features. Which finding would best distinguish the suspected cause from nearby Terraform configuration issues?
Explanation
Correct Answer
Plan shows deletion of the only active endpoint before a replacement is provisioned. A resource needing replacement has a default destroy-before-create behavior and a small production service has no other live replica. A replacement becomes available before the original is removed and validation catches name conflicts.
Incorrect Answers
Plan renders an invalid DNS record name even though every individual variable is a string. Plan shows deletion of the only active endpoint before a replacement is provisioned.
Plan contains only one nested rule and ignores additional values from the approved input list. Plan shows deletion of the only active endpoint before a replacement is provisioned.
Authorized state inspection still shows a password value for a provider argument that persists it. Plan shows deletion of the only active endpoint before a replacement is provisioned.
Question 125
For metering and outage response at an energy infrastructure operator, the infrastructure platform team is investigating the following incident: a configuration builds a service hostname by naive concatenation and omits a separator when environment input is empty. The relevant evidence is that plan renders an invalid DNS record name even though every individual variable is a string. The plan is to use explicit formatting and conditional expressions with validation of optional pieces. Which Terraform design principle best explains the chosen response?
Explanation
Correct Answer
Expressions and built-in functions derive reliable values only when type and edge cases are handled. A configuration builds a service hostname by naive concatenation and omits a separator when environment input is empty. Use explicit formatting and conditional expressions with validation of optional pieces.
Incorrect Answers
Secret management should externalize short-lived credentials and minimize exposure in configuration and state. A configuration builds a service hostname by naive concatenation and omits a separator when environment input is empty. Expressions and built-in functions derive reliable values only when type and edge cases are handled.
Input variables allow the same configuration to accept controlled environment-specific values. A configuration builds a service hostname by naive concatenation and omits a separator when environment input is empty. Expressions and built-in functions derive reliable values only when type and edge cases are handled.
Data source reads must be constrained because a lookup does not create or govern the referenced resource. Expressions and built-in functions derive reliable values only when type and edge cases are handled.
Question 126
During an authorized design and operations review at an aviation operations provider, engineers supporting airfield and ticketing services discover that a build environment exports TF_LOG=TRACE globally after troubleshooting an authentication failure. The relevant evidence is that subsequent CI artifacts contain verbose provider request and credential-adjacent diagnostic content. The plan is to disable debug logging after investigation and restrict access and retention of any captured log files. Which Terraform design principle best explains the chosen response?
Explanation
Correct Answer
Verbose logging should be temporary because high-detail logs may contain sensitive infrastructure data. Subsequent CI artifacts contain verbose provider request and credential-adjacent diagnostic content. Disable debug logging after investigation and restrict access and retention of any captured log files.
Incorrect Answers
Terraform state commands protect address and identity bookkeeping better than manual file edits. Subsequent CI artifacts contain verbose provider request and credential-adjacent diagnostic content. Verbose logging should be temporary because high-detail logs may contain sensitive infrastructure data.
The state CLI separates address discovery from attribute inspection. Subsequent CI artifacts contain verbose provider request and credential-adjacent diagnostic content. Verbose logging should be temporary because high-detail logs may contain sensitive infrastructure data.
Import adds an existing object to Terraform resource state rather than creating it. Subsequent CI artifacts contain verbose provider request and credential-adjacent diagnostic content. Verbose logging should be temporary because high-detail logs may contain sensitive infrastructure data.
Question 127
During an authorized design and operations review at a food distribution operator, engineers supporting warehouse and supply chain services discover that a service module provisions an endpoint whose returned access domain must match an approved suffix, but no Terraform condition checks this. Confirming evidence shows that provider returns a successful create while endpoint output points to an unexpected destination. Any change must preserve the approved model contract and show measurable verification evidence. Which implementation paired with its verification outcome addresses the same fault?
Explanation
Correct Answer
Use a supported resource postcondition or check assertion for the returned domain and fail review on mismatch. The condition reports the deviation and known-good endpoints pass the assertion. Provider returns a successful create while endpoint output points to an unexpected destination. Terraform custom conditions can test deployment assumptions beyond basic syntax and types.
Incorrect Answers
Use a supported resource postcondition or check assertion for the returned domain and fail review on mismatch. Authorized automation consumes the secret without exposing it in logs or unprotected artifacts. That uses the intended change yet measures the wrong result. The condition reports the deviation and known-good endpoints pass the assertion.
Use a supported resource postcondition or check assertion for the returned domain and fail review on mismatch. The plan reads the approved network identity without creating a duplicate. The remedy may be appropriate, but that check does not establish the required recovery. The condition reports the deviation and known-good endpoints pass the assertion.
Remove and revoke exposed credentials and authenticate to Vault with an approved short-lived runtime identity. No persistent token exists in Git or CI artifacts while authorized plans can retrieve temporary credentials. This pair concerns a different control or outcome, leaving the recorded fault unresolved. Use a supported resource postcondition or check assertion for the returned domain and fail review on mismatch; The condition reports the deviation and known-good endpoints pass the assertion.
Question 128
For analytics and private data feeds at a market data company, the infrastructure platform team is investigating the following incident: an application pins a module to a permissive version range and a new init selects a release with an incompatible output contract. The relevant evidence is that initialization log shows a new module version and plan errors on a removed output name. The plan is to select a reviewed module version range or exact approved version and test upgrade deliberately. Which Terraform design principle best explains the chosen response?
Explanation
Correct Answer
Registry module versions require deliberate constraints to prevent surprise interface changes. An application pins a module to a permissive version range and a new init selects a release with an incompatible output contract. Select a reviewed module version range or exact approved version and test upgrade deliberately.
Incorrect Answers
Module dependencies and data exchange are explicit rather than magical shared scopes. Registry module versions require deliberate constraints to prevent surprise interface changes.
Each Terraform module has its own variable and local namespace with explicit input boundaries. An application pins a module to a permissive version range and a new init selects a release with an incompatible output contract. Registry module versions require deliberate constraints to prevent surprise interface changes.
Terraform module source syntax and registry access determine how reusable configuration is retrieved. An application pins a module to a permissive version range and a new init selects a release with an incompatible output contract. Registry module versions require deliberate constraints to prevent surprise interface changes.
Question 129
For freight scheduling and depot services at a logistics technology company, the infrastructure platform team is investigating the following incident: a managed service resource contains no direct attribute reference to a security policy required for its bootstrap, so Terraform schedules them concurrently. The team proposes to add a narrow explicit depends_on edge for the real hidden side-effect dependency. Service owners require a reproducible result without unsafe or unapproved production testing. Which post-change observation would establish the required infrastructure or configuration outcome?
Explanation
Correct Answer
The required policy completes before service startup without introducing unnecessary serial dependencies. Plan graph shows independent operations while startup logs show dependency-related access failures. Add a narrow explicit depends_on edge for the real hidden side-effect dependency.
Incorrect Answers
All approved rules appear once in the generated plan without extra open ingress. The required policy completes before service startup without introducing unnecessary serial dependencies.
No persistent token exists in Git or CI artifacts while authorized plans can retrieve temporary credentials. Plan graph shows independent operations while startup logs show dependency-related access failures. The required policy completes before service startup without introducing unnecessary serial dependencies.
The plan reads the approved network identity without creating a duplicate. Plan graph shows independent operations while startup logs show dependency-related access failures. The required policy completes before service startup without introducing unnecessary serial dependencies.
Question 130
A controlled cloud model operations assessment for a regional nonprofit network concerns donor operations and learning systems. Reviewers find that a team downloads module code informally from chat instead of using the organization's approved private Terraform module registry. The proposed remedy is to publish and consume versioned modules through the HCP private registry with access controls. Any change must preserve the approved model contract and show measurable verification evidence. Which finding would best distinguish the suspected cause from nearby Terraform configuration issues?
Explanation
Correct Answer
Deployment repository contains unversioned module copies with no approved registry version or provenance. HCP Terraform private registry provides governed distribution of shared Terraform modules. Publish and consume versioned modules through the HCP private registry with access controls.
Incorrect Answers
HCP variable-set attachment page shows the wrong broad scope and affected workspace runs reference the unexpected variables. Deployment repository contains unversioned module copies with no approved registry version or provenance. Publish and consume versioned modules through the HCP private registry with access controls.
HCP workspace team access shows broad permissions that do not match the documented separation of duties. Publish and consume versioned modules through the HCP private registry with access controls.
Project and workspace permissions expose production runs to staff outside the responsible team. Deployment repository contains unversioned module copies with no approved registry version or provenance. Publish and consume versioned modules through the HCP private registry with access controls.
HashiCorp Certified: Terraform Associate (004) (Terraform Associate 004) Practice Tests
- HashiCorp Terraform Associate 004 Practice Test 11 - 10 Questions (Last Reviewed 18-Nov-2026)
- HashiCorp Terraform Associate 004 Practice Test 12 - 10 Questions (Last Reviewed 17-Nov-2026)
- HashiCorp Terraform Associate 004 Practice Test 13 - 10 Questions (Last Reviewed 16-Nov-2026)
- HashiCorp Terraform Associate 004 Practice Test 14 - 10 Questions (Last Reviewed 15-Nov-2026)
- HashiCorp Terraform Associate 004 Practice Test 15 - 10 Questions (Last Reviewed 14-Nov-2026)
