HashiCorp Terraform Associate 004 Practice Test 75
Question 740
When maintaining Terraform modules used by several application teams, the following condition occurs: A root Terraform stack tries to consume a network ID that the child module computes but does not publish as an output. The module interface must remain stable and reviewable. What should the engineer inspect FIRST to distinguish this issue from unrelated failures?
- Inspect the child module's output blocks and root expressions that refer to module.network values.
- Inspect the Git source URL, requested revision ref, and the actual module subdirectory layout.
- Trace the token through module input/output declarations and identify any output that exposes secret data.
- Check the module source address, allowed version range and current module selections from initialization.
Explanation
Correct Answer
A:Inspect the child module's output blocks and root expressions that refer to module.network values. Output values are the supported way for a module to expose results to its parent; ordinary child locals are not exported. A justified correction is: Add the intended child output declaration and access it through module.network.<output_name> in the caller. This matters here because when maintaining Terraform modules used by several application teams, the following condition occurs: A root….
Incorrect Answers
B:Inspect the Git source URL, requested revision ref, and the actual module subdirectory layout. This inspects git module source with explicit subdirectory rather than the reported child output exposure to calling module issue. The decisive investigation is: Inspect the child module's output blocks and root expressions that refer to module.network values.
C:Trace the token through module input/output declarations and identify any output that exposes secret data. This inspects sensitive input forwarding between nested modules rather than the reported child output exposure to calling module issue. The decisive investigation is: Inspect the child module's output blocks and root expressions that refer to module.network values. This matters here because when maintaining Terraform modules used by several application teams, the following condition occurs: A root….
D:Check the module source address, allowed version range and current module selections from initialization. This inspects registry module version pin to avoid breaking releases rather than the reported child output exposure to calling module issue. The decisive investigation is: Inspect the child module's output blocks and root expressions that refer to module.network values. This matters here because when maintaining Terraform modules used by several application teams, the following condition occurs: A root….
Question 741
During an isolated staging rehearsal of the Terraform workflow, the following condition occurs: A developer modifies a network tag but uses terraform init repeatedly, expecting initialization itself to apply the desired change to running resources. The operator must obtain auditable evidence before touching production resources. Select TWO: the decisive first check and the change that directly addresses the problem.
- Review the last plan and apply activity to distinguish provider initialization from planning and changing the managed resource.
- Use the write, init, plan, and apply sequence with a deliberate review checkpoint before changing the remote environment.
- Execute terraform init in the root configuration directory and resolve backend or provider setup failures before planning.
- Inspect the generated plan and approval prompt before deciding whether the operation has proceeded.
- Run terraform plan to evaluate the configuration change and terraform apply after review, rather than expecting terraform init to modify resources.
Explanation
Correct Answers
A:Review the last plan and apply activity to distinguish provider initialization from planning and changing the managed resource. Initialization configures the working directory; applying an execution plan is what reconciles managed infrastructure with configuration. A justified correction is: Run terraform plan to evaluate the configuration change and terraform apply after review, rather than expecting terraform init to modify resources. This forms one element of the required two-step diagnosis and correction. This matters here because a developer modifies a network tag but uses terraform init repeatedly, expecting initialization itself to apply the….
E:Run terraform plan to evaluate the configuration change and terraform apply after review, rather than expecting terraform init to modify resources. Initialization configures the working directory; applying an execution plan is what reconciles managed infrastructure with configuration. Confirm the cause with: Review the last plan and apply activity to distinguish provider initialization from planning and changing the managed resource. A concrete acceptance test is: A reviewed apply changes only the intended managed attribute and the subsequent plan shows no unexpected pending action. This forms one element of the required two-step diagnosis and correction. This matters here because a developer modifies a network tag but uses terraform init repeatedly, expecting initialization itself to apply the….
Incorrect Answers
B:Use the write, init, plan, and apply sequence with a deliberate review checkpoint before changing the remote environment. This relates to core write plan apply workflow order rather than the matching diagnosis-and-remediation pair required here. Check: Review the last plan and apply activity to distinguish provider initialization from planning and changing the managed resource. Then change: Run terraform plan to evaluate the configuration change and terraform apply after review, rather than expecting terraform init to modify resources. This matters here because a developer modifies a network tag but uses terraform init repeatedly, expecting initialization itself to apply the….
C:Execute terraform init in the root configuration directory and resolve backend or provider setup failures before planning. This relates to terraform init backend and provider preparation rather than the matching diagnosis-and-remediation pair required here. Check: Review the last plan and apply activity to distinguish provider initialization from planning and changing the managed resource. Then change: Run terraform plan to evaluate the configuration change and terraform apply after review, rather than expecting terraform init to modify resources.
D:Inspect the generated plan and approval prompt before deciding whether the operation has proceeded. This relates to apply requires approval unless automated rather than the matching diagnosis-and-remediation pair required here. Check: Review the last plan and apply activity to distinguish provider initialization from planning and changing the managed resource. Then change: Run terraform plan to evaluate the configuration change and terraform apply after review, rather than expecting terraform init to modify resources.
Question 742
During a cross-platform infrastructure standardization exercise, the following condition occurs: An organization provisions one application's storage in one cloud and DNS in another by maintaining incompatible manual deployment procedures. The decision must preserve ownership and minimize undocumented changes. What acceptance evidence best establishes that the Terraform issue has been resolved?
- An auditor can identify the approved commit and plan that caused a deliberate infrastructure capacity change.
- An unanticipated deletion or replacement is identified and blocked before a privileged apply can execute it.
- A plan can cover both managed targets while each provider operates only within its authorized platform and permissions.
- One reviewed workflow coordinates both cloud resources without pretending Terraform replaces the different underlying provider APIs.
Explanation
Correct Answer
D:One reviewed workflow coordinates both cloud resources without pretending Terraform replaces the different underlying provider APIs. Terraform provides a common declarative language while providers translate configuration operations into target platform APIs. It tests the correction: Use the relevant approved providers in Terraform and define cross-service references through managed configuration outputs or values. This matters here because an organization provisions one application's storage in one cloud and DNS in another by maintaining incompatible….
Incorrect Answers
A:An auditor can identify the approved commit and plan that caused a deliberate infrastructure capacity change. This might validate version-controlled iac change auditing, but it does not prove that multi-cloud providers under one terraform workflow was resolved. Confirm instead: One reviewed workflow coordinates both cloud resources without pretending Terraform replaces the different underlying provider APIs. This matters here because an organization provisions one application's storage in one cloud and DNS in another by maintaining incompatible….
B:An unanticipated deletion or replacement is identified and blocked before a privileged apply can execute it. This might validate terraform plan review as change safety barrier, but it does not prove that multi-cloud providers under one terraform workflow was resolved. Confirm instead: One reviewed workflow coordinates both cloud resources without pretending Terraform replaces the different underlying provider APIs.
C:A plan can cover both managed targets while each provider operates only within its authorized platform and permissions. This might validate hybrid cloud workflow with distinct provider credentials, but it does not prove that multi-cloud providers under one terraform workflow was resolved. Confirm instead: One reviewed workflow coordinates both cloud resources without pretending Terraform replaces the different underlying provider APIs.
Question 743
When reviewing a reusable Terraform HCL configuration before deployment, the following condition occurs: A database connection output includes a password but the author marks only the input variable as sensitive and expects every derived output to be safely hidden in command output. The engineer must respect declared resource contracts and data security boundaries. Which outcome most directly validates the intended fix?
- The module plans with a deliberate region value rather than failing for a missing required input.
- Routine Terraform output suppresses the marked secret while protected state access remains restricted.
- The plan selects the correct per-environment instance size without relying on arbitrary key ordering.
- An invalid subnet input fails with a clear Terraform validation error while authorized values continue to plan.
Explanation
Correct Answer
B:Routine Terraform output suppresses the marked secret while protected state access remains restricted. Sensitivity metadata affects presentation, not a guarantee that secret bytes have been removed from state or all other surfaces. It tests the correction: Mark secret-bearing outputs sensitive when appropriate, restrict state access, and avoid exposing secret material through ordinary output values. This matters here because when reviewing a reusable Terraform HCL configuration before deployment, the following condition occurs: A database….
Incorrect Answers
A:The module plans with a deliberate region value rather than failing for a missing required input. This might validate variable default versus required input, but it does not prove that sensitive output display behavior was resolved. Confirm instead: Routine Terraform output suppresses the marked secret while protected state access remains restricted. This matters here because when reviewing a reusable Terraform HCL configuration before deployment, the following condition occurs: A database….
C:The plan selects the correct per-environment instance size without relying on arbitrary key ordering. This might validate map versus list addressing for environment inputs, but it does not prove that sensitive output display behavior was resolved. Confirm instead: Routine Terraform output suppresses the marked secret while protected state access remains restricted. This matters here because when reviewing a reusable Terraform HCL configuration before deployment, the following condition occurs: A database….
D:An invalid subnet input fails with a clear Terraform validation error while authorized values continue to plan. This might validate input variable custom validation rule, but it does not prove that sensitive output display behavior was resolved. Confirm instead: Routine Terraform output suppresses the marked secret while protected state access remains restricted.
Question 744
During a controlled module integration test for a production Terraform stack, the following condition occurs: A reusable module expects a region input but has no default, and a new caller assumes Terraform will infer a region from the module source. The desired fix must avoid unrelated resource changes. What should the engineer inspect FIRST to distinguish this issue from unrelated failures?
- Inspect the variable declaration, resource schema, and stored state behavior for that password input.
- Inspect variable blocks for type/default arguments and the module call for an explicitly supplied input value.
- Inspect command-line var flags, tfvars files, Terraform variable environment entries, and workspace variable values.
- Inspect the graph for a dependency edge and confirm the service genuinely requires the policy to exist first.
Explanation
Correct Answer
B:Inspect variable blocks for type/default arguments and the module call for an explicitly supplied input value. Input variables lacking defaults are required at the module boundary; module source addresses do not implicitly supply their values. A justified correction is: Provide the required region input through the module call or a supported root variable assignment mechanism. This matters here because during a controlled module integration test for a production Terraform stack, the following condition occurs: A….
Incorrect Answers
A:Inspect the variable declaration, resource schema, and stored state behavior for that password input. This inspects sensitive variable does not erase state secrets rather than the reported variable default versus required input issue. The decisive investigation is: Inspect variable blocks for type/default arguments and the module call for an explicitly supplied input value. This matters here because during a controlled module integration test for a production Terraform stack, the following condition occurs: A….
C:Inspect command-line var flags, tfvars files, Terraform variable environment entries, and workspace variable values. This inspects variable input precedence and configuration injection rather than the reported variable default versus required input issue. The decisive investigation is: Inspect variable blocks for type/default arguments and the module call for an explicitly supplied input value.
D:Inspect the graph for a dependency edge and confirm the service genuinely requires the policy to exist first. This inspects explicit depends_on for behavior-only dependencies rather than the reported variable default versus required input issue. The decisive investigation is: Inspect variable blocks for type/default arguments and the module call for an explicitly supplied input value.
Question 745
During a cross-platform infrastructure standardization exercise, the following condition occurs: Two automation systems both change the same cloud storage policy, and repeated Terraform applies continuously undo the other controller's modifications. The decision must preserve ownership and minimize undocumented changes. Which outcome most directly validates the intended fix?
- An auditor can identify the approved commit and plan that caused a deliberate infrastructure capacity change.
- A plan can cover both managed targets while each provider operates only within its authorized platform and permissions.
- Reviewers can trace a proposed firewall change to an audited configuration diff and plan before any infrastructure changes.
- A series of Terraform plans remains stable after independent automation without oscillating policy settings between tools.
Explanation
Correct Answer
D:A series of Terraform plans remains stable after independent automation without oscillating policy settings between tools. Declarative reconciliation requires a clear ownership contract; competing controllers can create perpetual drift. It tests the correction: Assign authoritative ownership to one control plane or explicitly divide attribute responsibility using supported lifecycle practices. This matters here because two automation systems both change the same cloud storage policy, and repeated Terraform applies continuously undo….
Incorrect Answers
A:An auditor can identify the approved commit and plan that caused a deliberate infrastructure capacity change. This might validate version-controlled iac change auditing, but it does not prove that terraform resource ownership boundary was resolved. Confirm instead: A series of Terraform plans remains stable after independent automation without oscillating policy settings between tools. This matters here because two automation systems both change the same cloud storage policy, and repeated Terraform applies continuously undo….
B:A plan can cover both managed targets while each provider operates only within its authorized platform and permissions. This might validate hybrid cloud workflow with distinct provider credentials, but it does not prove that terraform resource ownership boundary was resolved. Confirm instead: A series of Terraform plans remains stable after independent automation without oscillating policy settings between tools.
C:Reviewers can trace a proposed firewall change to an audited configuration diff and plan before any infrastructure changes. This might validate terraform configuration as reviewable infrastructure specification, but it does not prove that terraform resource ownership boundary was resolved. Confirm instead: A series of Terraform plans remains stable after independent automation without oscillating policy settings between tools. This matters here because two automation systems both change the same cloud storage policy, and repeated Terraform applies continuously undo….
Question 746
During a cross-platform infrastructure standardization exercise, the following condition occurs: A risky network change is applied immediately through a console even though a routine maintenance window requires estimating resource replacements first. The decision must preserve ownership and minimize undocumented changes. What should the engineer inspect FIRST to distinguish this issue from unrelated failures?
- Identify which attributes Terraform declares and which external system writes to the same managed object between runs.
- Inspect whether the deployment process captures a proposed execution plan and identifies create, update, delete, and replacement actions.
- Compare provider-specific resource schemas, instance properties, network dependencies, and modules' input interfaces.
- Inspect infrastructure change logs, commit reviews, and whether the active resources map to revision-controlled Terraform configuration.
Explanation
Correct Answer
B:Inspect whether the deployment process captures a proposed execution plan and identifies create, update, delete, and replacement actions. Plan review helps forecast proposed infrastructure changes, though unknown provider values and external drift can still affect final outcomes. A justified correction is: Run a reviewed Terraform plan before application, investigate unexpected replacements, and require appropriate authorization. This matters here because a risky network change is applied immediately through a console even though a routine maintenance window requires….
Incorrect Answers
A:Identify which attributes Terraform declares and which external system writes to the same managed object between runs. This inspects terraform resource ownership boundary rather than the reported terraform plan review as change safety barrier issue. The decisive investigation is: Inspect whether the deployment process captures a proposed execution plan and identifies create, update, delete, and replacement actions.
C:Compare provider-specific resource schemas, instance properties, network dependencies, and modules' input interfaces. This inspects provider-neutral infrastructure pattern without identical resource types rather than the reported terraform plan review as change safety barrier issue. The decisive investigation is: Inspect whether the deployment process captures a proposed execution plan and identifies create, update, delete, and replacement actions. This matters here because a risky network change is applied immediately through a console even though a routine maintenance window requires….
D:Inspect infrastructure change logs, commit reviews, and whether the active resources map to revision-controlled Terraform configuration. This inspects version-controlled iac change auditing rather than the reported terraform plan review as change safety barrier issue. The decisive investigation is: Inspect whether the deployment process captures a proposed execution plan and identifies create, update, delete, and replacement actions. This matters here because a risky network change is applied immediately through a console even though a routine maintenance window requires….
Question 747
During a controlled module integration test for a production Terraform stack, the following condition occurs: A database provider supports a write-only password argument, but an engineer uses a normal stored password argument and checks the plan artifact into an unsecured archive. The desired fix must avoid unrelated resource changes. Which proposed remediation solves this failure without masking its cause?
- Supply a supported write-only password argument from an ephemeral value and use the provider's explicit version mechanism when required.
- Declare the token input as ephemeral = true and pass it only into compatible runtime contexts such as provider configuration.
- Use a lifecycle precondition with a precise boolean condition and actionable error message on the resource.
- Use an appropriate map type with key-based lookup or redesign the input as a list if order-based indexing is truly intended.
Explanation
Correct Answer
A:Supply a supported write-only password argument from an ephemeral value and use the provider's explicit version mechanism when required. Write-only resource arguments accept values during an operation without saving those values into Terraform's managed state. Confirm the cause with: Inspect the provider resource schema for supported write-only arguments and associated rotation or version requirements. A concrete acceptance test is: The provider receives the approved new secret without persisting its plaintext in Terraform's plan or state snapshots. This matters here because during a controlled module integration test for a production Terraform stack, the following condition occurs: A….
Incorrect Answers
B:Declare the token input as ephemeral = true and pass it only into compatible runtime contexts such as provider configuration. This could address ephemeral variable for short-lived token in terraform 1.12, but it does not correct the indicated write-only provider argument for managed secret rotation mechanism. The relevant fix is: Supply a supported write-only password argument from an ephemeral value and use the provider's explicit version mechanism when required. This matters here because during a controlled module integration test for a production Terraform stack, the following condition occurs: A….
C:Use a lifecycle precondition with a precise boolean condition and actionable error message on the resource. This could address resource precondition for unsafe configuration, but it does not correct the indicated write-only provider argument for managed secret rotation mechanism. The relevant fix is: Supply a supported write-only password argument from an ephemeral value and use the provider's explicit version mechanism when required.
D:Use an appropriate map type with key-based lookup or redesign the input as a list if order-based indexing is truly intended. This could address map versus list addressing for environment inputs, but it does not correct the indicated write-only provider argument for managed secret rotation mechanism. The relevant fix is: Supply a supported write-only password argument from an ephemeral value and use the provider's explicit version mechanism when required.
Question 748
During an operational review of a Terraform state backend, the following condition occurs: An administrator intentionally changes a provider-computed tag outside Terraform and wants the tracked state to reflect reality without reverting any remote resource. The team must preserve managed-object identity and safe collaboration. Which Terraform configuration or workflow change most directly corrects the described issue?
- Use the backend's supported environment or short-lived credential mechanism instead of hardcoding secrets into backend configuration.
- Apply a reviewed refresh-only plan when appropriate to synchronize state with current remote objects without an infrastructure change.
- Review whether to restore desired IaC attributes or update configuration deliberately to adopt the observed change.
- Wait for or safely resolve the conflicting operation and keep backend-supported state locking enabled.
Explanation
Correct Answer
B:Apply a reviewed refresh-only plan when appropriate to synchronize state with current remote objects without an infrastructure change. Refresh-only mode reconciles tracked state with observed infrastructure; normal apply may instead modify infrastructure to match configuration. Confirm the cause with: Inspect terraform plan -refresh-only and distinguish state/output updates from normal planned infrastructure modifications. A concrete acceptance test is: The state snapshot reflects the latest remote observation and no Terraform-driven remote object mutation occurs during that operation. This matters here because an administrator intentionally changes a provider-computed tag outside Terraform and wants the tracked state to….
Incorrect Answers
A:Use the backend's supported environment or short-lived credential mechanism instead of hardcoding secrets into backend configuration. This could address backend credentials kept out of plan artifacts, but it does not correct the indicated refresh-only state update without infrastructure mutation mechanism. The relevant fix is: Apply a reviewed refresh-only plan when appropriate to synchronize state with current remote objects without an infrastructure change. This matters here because an administrator intentionally changes a provider-computed tag outside Terraform and wants the tracked state to….
C:Review whether to restore desired IaC attributes or update configuration deliberately to adopt the observed change. This could address out-of-band drift detection in managed resource, but it does not correct the indicated refresh-only state update without infrastructure mutation mechanism. The relevant fix is: Apply a reviewed refresh-only plan when appropriate to synchronize state with current remote objects without an infrastructure change. This matters here because an administrator intentionally changes a provider-computed tag outside Terraform and wants the tracked state to….
D:Wait for or safely resolve the conflicting operation and keep backend-supported state locking enabled. This could address state locking prevents concurrent writes, but it does not correct the indicated refresh-only state update without infrastructure mutation mechanism. The relevant fix is: Apply a reviewed refresh-only plan when appropriate to synchronize state with current remote objects without an infrastructure change.
Question 749
During an operational review of a Terraform state backend, the following condition occurs: An administrator intentionally changes a provider-computed tag outside Terraform and wants the tracked state to reflect reality without reverting any remote resource. The team must preserve managed-object identity and safe collaboration. Which investigation would most directly establish the reported Terraform failure?
- Inspect active runs and lock metadata to determine whether another legitimate operation owns the state lock.
- Inspect the selected terraform workspace and the backend's paths used for nondefault workspace state.
- Compare old and new resource addresses and verify the provider object is the same logical managed resource.
- Inspect terraform plan -refresh-only and distinguish state/output updates from normal planned infrastructure modifications.
Explanation
Correct Answer
D:Inspect terraform plan -refresh-only and distinguish state/output updates from normal planned infrastructure modifications. Refresh-only mode reconciles tracked state with observed infrastructure; normal apply may instead modify infrastructure to match configuration. A justified correction is: Apply a reviewed refresh-only plan when appropriate to synchronize state with current remote objects without an infrastructure change. This matters here because an administrator intentionally changes a provider-computed tag outside Terraform and wants the tracked state to….
Incorrect Answers
A:Inspect active runs and lock metadata to determine whether another legitimate operation owns the state lock. This inspects state locking prevents concurrent writes rather than the reported refresh-only state update without infrastructure mutation issue. The decisive investigation is: Inspect terraform plan -refresh-only and distinguish state/output updates from normal planned infrastructure modifications. This matters here because an administrator intentionally changes a provider-computed tag outside Terraform and wants the tracked state to….
B:Inspect the selected terraform workspace and the backend's paths used for nondefault workspace state. This inspects local workspace state separation rather than the reported refresh-only state update without infrastructure mutation issue. The decisive investigation is: Inspect terraform plan -refresh-only and distinguish state/output updates from normal planned infrastructure modifications.
C:Compare old and new resource addresses and verify the provider object is the same logical managed resource. This inspects moved block preserves state during address refactor rather than the reported refresh-only state update without infrastructure mutation issue. The decisive investigation is: Inspect terraform plan -refresh-only and distinguish state/output updates from normal planned infrastructure modifications. This matters here because an administrator intentionally changes a provider-computed tag outside Terraform and wants the tracked state to….
Question 750
When reviewing a reusable Terraform HCL configuration before deployment, the following condition occurs: A list of application names drives count-based resources, and removing one name shifts indices so Terraform plans to replace unrelated applications. The engineer must respect declared resource contracts and data security boundaries. Which diagnostic check provides the strongest evidence for the underlying problem?
- Inspect the variable's ephemeral setting and whether downstream use is an allowed ephemeral context such as provider configuration.
- Inspect the subnet and server blocks for real attribute references versus unrelated hardcoded strings.
- Inspect the input values and expressions used to construct resource names and tags.
- Inspect state instance addresses and compare count positions against stable business keys.
Explanation
Correct Answer
D:Inspect state instance addresses and compare count positions against stable business keys. Count identifies instances by numeric position, while for_each keys can preserve stable identity across list ordering changes. A justified correction is: Use for_each over stable unique names and migrate existing addresses with reviewed moved blocks where appropriate. This matters here because when reviewing a reusable Terraform HCL configuration before deployment, the following condition occurs: A list of….
Incorrect Answers
A:Inspect the variable's ephemeral setting and whether downstream use is an allowed ephemeral context such as provider configuration. This inspects ephemeral variable for short-lived token in terraform 1.12 rather than the reported for_each stable identity instead of count index issue. The decisive investigation is: Inspect state instance addresses and compare count positions against stable business keys. This matters here because when reviewing a reusable Terraform HCL configuration before deployment, the following condition occurs: A list of….
B:Inspect the subnet and server blocks for real attribute references versus unrelated hardcoded strings. This inspects implicit dependency through resource attribute reference rather than the reported for_each stable identity instead of count index issue. The decisive investigation is: Inspect state instance addresses and compare count positions against stable business keys.
C:Inspect the input values and expressions used to construct resource names and tags. This inspects built-in functions for deterministic naming rather than the reported for_each stable identity instead of count index issue. The decisive investigation is: Inspect state instance addresses and compare count positions against stable business keys.