HashiCorp Terraform Associate 004 Practice Test 60
Question 590
During a separate-region Terraform rollout in an approved staging account, the following condition occurs: A team expects the Terraform CLI to create cloud database resources without installing the provider named by their resource types. The configuration should behave consistently without broadening access. Which outcome most directly validates the intended fix?
- Terraform can plan supported target API operations through the selected provider plugin and reports schema errors when arguments are invalid.
- The same initialized provider can read the required resource metadata using an approved identity and the access-denied error disappears.
- The plan uses the reviewed new compatible provider version and the updated lock file captures it for teammates.
- Read and write operations in one account do not gain unnecessary authorization to unrelated account resources.
Explanation
Correct Answer
A:Terraform can plan supported target API operations through the selected provider plugin and reports schema errors when arguments are invalid. Terraform core evaluates configuration and resource graphs while provider plugins implement platform-specific CRUD and read behavior. It tests the correction: Install and configure the appropriate provider through terraform init so Terraform can use its resource and data source implementations. This matters here because during a separate-region Terraform rollout in an approved staging account, the following condition occurs: A team….
Incorrect Answers
B:The same initialized provider can read the required resource metadata using an approved identity and the access-denied error disappears. This might validate provider authorization versus installation failure, but it does not prove that provider plugin manages api resources and data reads was resolved. Confirm instead: Terraform can plan supported target API operations through the selected provider plugin and reports schema errors when arguments are invalid. This matters here because during a separate-region Terraform rollout in an approved staging account, the following condition occurs: A team….
C:The plan uses the reviewed new compatible provider version and the updated lock file captures it for teammates. This might validate controlled provider upgrade using init upgrade, but it does not prove that provider plugin manages api resources and data reads was resolved. Confirm instead: Terraform can plan supported target API operations through the selected provider plugin and reports schema errors when arguments are invalid. This matters here because during a separate-region Terraform rollout in an approved staging account, the following condition occurs: A team….
D:Read and write operations in one account do not gain unnecessary authorization to unrelated account resources. This might validate multiple provider instances requiring separate authentication, but it does not prove that provider plugin manages api resources and data reads was resolved. Confirm instead: Terraform can plan supported target API operations through the selected provider plugin and reports schema errors when arguments are invalid.
Question 591
While migrating a manually maintained development environment into reviewed Terraform configuration, 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 team must establish a reproducible and auditable infrastructure change. Select TWO: the decisive first check and the change that directly addresses the problem.
- Compare repeated environment requirements against current configuration differences and find parameters that should vary intentionally.
- Check whether each API integration has a Terraform provider and how dependencies pass resource attributes between configurations.
- Use the relevant approved providers in Terraform and define cross-service references through managed configuration outputs or values.
- Create separate provider-aware modules behind a shared application interface rather than treating resource type names as portable across platforms.
- Assign authoritative ownership to one control plane or explicitly divide attribute responsibility using supported lifecycle practices.
Explanation
Correct Answers
B:Check whether each API integration has a Terraform provider and how dependencies pass resource attributes between configurations. Terraform provides a common declarative language while providers translate configuration operations into target platform APIs. A justified correction is: Use the relevant approved providers in Terraform and define cross-service references through managed configuration outputs or values. This forms one element of the required two-step diagnosis and correction. This matters here because while migrating a manually maintained development environment into reviewed Terraform configuration, the following….
C:Use the relevant approved providers in Terraform and define cross-service references through managed configuration outputs or values. Terraform provides a common declarative language while providers translate configuration operations into target platform APIs. Confirm the cause with: Check whether each API integration has a Terraform provider and how dependencies pass resource attributes between configurations. A concrete acceptance test is: One reviewed workflow coordinates both cloud resources without pretending Terraform replaces the different underlying provider APIs. This forms one element of the required two-step diagnosis and correction. This matters here because while migrating a manually maintained development environment into reviewed Terraform configuration, the following….
Incorrect Answers
A:Compare repeated environment requirements against current configuration differences and find parameters that should vary intentionally. This relates to reusable environment definitions and reduced configuration drift rather than the matching diagnosis-and-remediation pair required here. Check: Check whether each API integration has a Terraform provider and how dependencies pass resource attributes between configurations. Then change: Use the relevant approved providers in Terraform and define cross-service references through managed configuration outputs or values.
D:Create separate provider-aware modules behind a shared application interface rather than treating resource type names as portable across platforms. This relates to provider-neutral infrastructure pattern without identical resource types rather than the matching diagnosis-and-remediation pair required here. Check: Check whether each API integration has a Terraform provider and how dependencies pass resource attributes between configurations. Then change: Use the relevant approved providers in Terraform and define cross-service references through managed configuration outputs or values. This matters here because while migrating a manually maintained development environment into reviewed Terraform configuration, the following….
E:Assign authoritative ownership to one control plane or explicitly divide attribute responsibility using supported lifecycle practices. This relates to terraform resource ownership boundary rather than the matching diagnosis-and-remediation pair required here. Check: Check whether each API integration has a Terraform provider and how dependencies pass resource attributes between configurations. Then change: Use the relevant approved providers in Terraform and define cross-service references through managed configuration outputs or values.
Question 592
During a cross-platform infrastructure standardization exercise, the following condition occurs: An operations group records a sequence of manual console clicks to provision identical test environments, but the resulting infrastructure differs between operators. The decision must preserve ownership and minimize undocumented changes. Which diagnostic check provides the strongest evidence for the underlying problem?
- Check whether each API integration has a Terraform provider and how dependencies pass resource attributes between configurations.
- Compare the runbook's procedural steps with a version-controlled declarative inventory of desired resources and their attributes.
- Inspect whether infrastructure choices and dependencies exist as tracked Terraform files or only as undocumented console modifications.
- Compare repeated environment requirements against current configuration differences and find parameters that should vary intentionally.
Explanation
Correct Answer
B:Compare the runbook's procedural steps with a version-controlled declarative inventory of desired resources and their attributes. Infrastructure as code declares a desired resource graph; repeated manual commands are not a reliable description of end state. A justified correction is: Express the intended resources in Terraform configuration and review its generated plan before applying a consistent desired state.
Incorrect Answers
A:Check whether each API integration has a Terraform provider and how dependencies pass resource attributes between configurations. This inspects multi-cloud providers under one terraform workflow rather than the reported declarative desired state versus imperative console runbook issue. The decisive investigation is: Compare the runbook's procedural steps with a version-controlled declarative inventory of desired resources and their attributes.
C:Inspect whether infrastructure choices and dependencies exist as tracked Terraform files or only as undocumented console modifications. This inspects terraform configuration as reviewable infrastructure specification rather than the reported declarative desired state versus imperative console runbook issue. The decisive investigation is: Compare the runbook's procedural steps with a version-controlled declarative inventory of desired resources and their attributes.
D:Compare repeated environment requirements against current configuration differences and find parameters that should vary intentionally. This inspects reusable environment definitions and reduced configuration drift rather than the reported declarative desired state versus imperative console runbook issue. The decisive investigation is: Compare the runbook's procedural steps with a version-controlled declarative inventory of desired resources and their attributes.
Question 593
During a controlled module integration test for a production Terraform stack, 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 desired fix must avoid unrelated resource changes. What acceptance evidence best establishes that the Terraform issue has been resolved?
- The module plans with a deliberate region value rather than failing for a missing required input.
- The plan selects the correct per-environment instance size without relying on arbitrary key ordering.
- Routine Terraform output suppresses the marked secret while protected state access remains restricted.
- The plan resolves the intended instance and avoids accidental replacement caused solely by a configuration address rename.
Explanation
Correct Answer
C: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.
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.
B: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.
D:The plan resolves the intended instance and avoids accidental replacement caused solely by a configuration address rename. This might validate resource addressing with repeated instances, 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 594
During an isolated staging rehearsal of the Terraform workflow, the following condition occurs: Two contributors produce equivalent Terraform expressions using inconsistent spacing and indentation, causing noisy reviews despite no actual infrastructure differences. The operator must obtain auditable evidence before touching production resources. Which diagnostic check provides the strongest evidence for the underlying problem?
- Inspect the module source declaration and initialization logs for the missing module download.
- Inspect the generated plan and approval prompt before deciding whether the operation has proceeded.
- Inspect the current HCL formatting and whether a standard terraform fmt check flags style-only differences.
- Inspect the terraform fmt -check -diff output and separate style failures from terraform validate diagnostics.
Explanation
Correct Answer
C:Inspect the current HCL formatting and whether a standard terraform fmt check flags style-only differences. terraform fmt standardizes syntax layout; it is not a validation of cloud permissions or a deployment action. A justified correction is: Run terraform fmt or terraform fmt -recursive where intended, then review the resulting source formatting changes. This matters here because two contributors produce equivalent Terraform expressions using inconsistent spacing and indentation, causing noisy….
Incorrect Answers
A:Inspect the module source declaration and initialization logs for the missing module download. This inspects module installation during initial setup rather than the reported terraform fmt normalizes hcl style issue. The decisive investigation is: Inspect the current HCL formatting and whether a standard terraform fmt check flags style-only differences.
B:Inspect the generated plan and approval prompt before deciding whether the operation has proceeded. This inspects apply requires approval unless automated rather than the reported terraform fmt normalizes hcl style issue. The decisive investigation is: Inspect the current HCL formatting and whether a standard terraform fmt check flags style-only differences.
D:Inspect the terraform fmt -check -diff output and separate style failures from terraform validate diagnostics. This inspects ci terraform fmt check distinguishes style from validity rather than the reported terraform fmt normalizes hcl style issue. The decisive investigation is: Inspect the current HCL formatting and whether a standard terraform fmt check flags style-only differences. This matters here because two contributors produce equivalent Terraform expressions using inconsistent spacing and indentation, causing noisy….
Question 595
During an operational review of a Terraform state backend, the following condition occurs: A developer switches Terraform CLI workspaces using a local backend and assumes all named workspaces write to the same terraform.tfstate file. The team must preserve managed-object identity and safe collaboration. What should the engineer inspect FIRST to distinguish this issue from unrelated failures?
- 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.
- Inspect the backend configuration and state file location on each workstation to identify local state behavior.
- Inspect terraform plan -refresh-only and distinguish state/output updates from normal planned infrastructure modifications.
Explanation
Correct Answer
B:Inspect the selected terraform workspace and the backend's paths used for nondefault workspace state. Local backend workspaces have separate state snapshots, though they share the same configuration and local backend mechanism. A justified correction is: Select the intended workspace before planning and check the corresponding workspace-specific state directory. This matters here because a developer switches Terraform CLI workspaces using a local backend and assumes all named workspaces write to the….
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 local workspace state separation issue. The decisive investigation is: Inspect the selected terraform workspace and the backend's paths used for nondefault workspace state.
C:Inspect the backend configuration and state file location on each workstation to identify local state behavior. This inspects local backend path and exposure rather than the reported local workspace state separation issue. The decisive investigation is: Inspect the selected terraform workspace and the backend's paths used for nondefault workspace state. This matters here because a developer switches Terraform CLI workspaces using a local backend and assumes all named workspaces write to the….
D:Inspect terraform plan -refresh-only and distinguish state/output updates from normal planned infrastructure modifications. This inspects refresh-only state update without infrastructure mutation rather than the reported local workspace state separation issue. The decisive investigation is: Inspect the selected terraform workspace and the backend's paths used for nondefault workspace state. This matters here because a developer switches Terraform CLI workspaces using a local backend and assumes all named workspaces write to the….
Question 596
As the deployment team prepares a reviewed Terraform CLI change, the following condition occurs: A CI pipeline generates a plan for review but later runs terraform apply without supplying the saved plan, allowing freshly computed changes that were not approved. The change must preserve the distinction between previewing and modifying infrastructure. What targeted engineering response should the team implement?
- Generate a versioned saved plan and apply the reviewed binary plan file within the approved run context, protecting its sensitive content.
- Use terraform validate to catch configuration errors and separately run plan or controlled provider checks to assess remote feasibility.
- Use the normal full dependency-aware plan and apply workflow; reserve targeting for exceptional recovery rather than routine deployment.
- Decide whether to restore declared configuration or intentionally adopt the outside value, then plan under the chosen ownership policy.
Explanation
Correct Answer
A:Generate a versioned saved plan and apply the reviewed binary plan file within the approved run context, protecting its sensitive content. An applied saved plan preserves the planned decisions at creation time; plan artifacts can hold secrets and require restricted storage. Confirm the cause with: Inspect whether the approved artifact was produced by terraform plan -out and whether apply consumes exactly that plan artifact. A concrete acceptance test is: The apply executes the selected reviewed plan instead of silently producing a new unreviewed plan from changed inputs. This matters here because as the deployment team prepares a reviewed Terraform CLI change, the following condition occurs: A CI pipeline….
Incorrect Answers
B:Use terraform validate to catch configuration errors and separately run plan or controlled provider checks to assess remote feasibility. This could address terraform validate versus cloud permission testing, but it does not correct the indicated saved execution plan for controlled deployment mechanism. The relevant fix is: Generate a versioned saved plan and apply the reviewed binary plan file within the approved run context, protecting its sensitive content.
C:Use the normal full dependency-aware plan and apply workflow; reserve targeting for exceptional recovery rather than routine deployment. This could address targeted apply limitations for normal changes, but it does not correct the indicated saved execution plan for controlled deployment mechanism. The relevant fix is: Generate a versioned saved plan and apply the reviewed binary plan file within the approved run context, protecting its sensitive content.
D:Decide whether to restore declared configuration or intentionally adopt the outside value, then plan under the chosen ownership policy. This could address plan versus real infrastructure drift, but it does not correct the indicated saved execution plan for controlled deployment mechanism. The relevant fix is: Generate a versioned saved plan and apply the reviewed binary plan file within the approved run context, protecting its sensitive content. This matters here because as the deployment team prepares a reviewed Terraform CLI change, the following condition occurs: A CI pipeline….
Question 597
During a clean initialization of a newly composed infrastructure root module, the following condition occurs: A module source from the public registry resolves to an unexpected major version after a new release and changes its input contract. The team must preserve reproducibility across callers. What should the engineer inspect FIRST to distinguish this issue from unrelated failures?
- Compare the upgraded module's documented input/output contract to root references before approving the module version change.
- Check the module source address, allowed version range and current module selections from initialization.
- Inspect the parent composition and whether the network child provides an output representing the created subnet.
- Inspect the module source value and the repository layout relative to the directory containing the calling module.
Explanation
Correct Answer
B:Check the module source address, allowed version range and current module selections from initialization. Registry module versions follow explicit constraints; leaving compatibility open can cause unreviewed module interface changes. A justified correction is: Add an appropriate version constraint for a registry module and review upgrades with plans and compatibility tests. This matters here because during a clean initialization of a newly composed infrastructure root module, the following condition occurs: A….
Incorrect Answers
A:Compare the upgraded module's documented input/output contract to root references before approving the module version change. This inspects module upgrade plan review with changed outputs rather than the reported registry module version pin to avoid breaking releases issue. The decisive investigation is: Check the module source address, allowed version range and current module selections from initialization.
C:Inspect the parent composition and whether the network child provides an output representing the created subnet. This inspects module outputs coordinate dependencies instead of duplicate data rather than the reported registry module version pin to avoid breaking releases issue. The decisive investigation is: Check the module source address, allowed version range and current module selections from initialization.
D:Inspect the module source value and the repository layout relative to the directory containing the calling module. This inspects local child module source path resolution rather than the reported registry module version pin to avoid breaking releases issue. The decisive investigation is: Check the module source address, allowed version range and current module selections from initialization.
Question 598
During a separate-region Terraform rollout in an approved staging account, the following condition occurs: A root configuration defines an alias for a secondary region, but its child module provisions resources in the primary region because the provider mapping is omitted. The configuration should behave consistently without broadening access. Which outcome most directly validates the intended fix?
- The first plan marks unknown values appropriately and a subsequent apply publishes the actual ID through the tracked state.
- The plan identifies production-account resources under the intended provider configuration while development objects remain separate.
- The child module's resources are planned under the intended alternate region rather than silently using the default provider.
- Routine initialization stays within the intended major version while explicit change review governs the next major update.
Explanation
Correct Answer
C:The child module's resources are planned under the intended alternate region rather than silently using the default provider. Provider configurations are supplied by module callers; module source files do not automatically inherit arbitrary aliases by matching their names. It tests the correction: Pass the correct provider configuration explicitly through the module's providers map and declare configuration_aliases when required. This matters here because during a separate-region Terraform rollout in an approved staging account, the following condition occurs: A root….
Incorrect Answers
A:The first plan marks unknown values appropriately and a subsequent apply publishes the actual ID through the tracked state. This might validate resource attribute outputs supplied by state, but it does not prove that module provider mapping for aliased configurations was resolved. Confirm instead: The child module's resources are planned under the intended alternate region rather than silently using the default provider. This matters here because during a separate-region Terraform rollout in an approved staging account, the following condition occurs: A root….
B:The plan identifies production-account resources under the intended provider configuration while development objects remain separate. This might validate provider alias for multiple accounts, but it does not prove that module provider mapping for aliased configurations was resolved. Confirm instead: The child module's resources are planned under the intended alternate region rather than silently using the default provider. This matters here because during a separate-region Terraform rollout in an approved staging account, the following condition occurs: A root….
D:Routine initialization stays within the intended major version while explicit change review governs the next major update. This might validate provider version range semantics, but it does not prove that module provider mapping for aliased configurations was resolved. Confirm instead: The child module's resources are planned under the intended alternate region rather than silently using the default provider.
Question 599
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 TWO options together provide the relevant diagnosis and its targeted remediation? Select TWO.
- Use the backend's supported environment or short-lived credential mechanism instead of hardcoding secrets into backend configuration.
- Review whether to restore desired IaC attributes or update configuration deliberately to adopt the observed change.
- Inspect the backend configuration and state file location on each workstation to identify local state behavior.
- Apply a reviewed refresh-only plan when appropriate to synchronize state with current remote objects without an infrastructure change.
- Inspect terraform plan -refresh-only and distinguish state/output updates from normal planned infrastructure modifications.
Explanation
Correct Answers
D: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 forms one element of the required two-step diagnosis and correction. This matters here because an administrator intentionally changes a provider-computed tag outside Terraform and wants the tracked state to….
E: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 forms one element of the required two-step diagnosis and correction. 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 relates to backend credentials kept out of plan artifacts rather than the matching diagnosis-and-remediation pair required here. Check: Inspect terraform plan -refresh-only and distinguish state/output updates from normal planned infrastructure modifications. Then change: Apply a reviewed refresh-only plan when appropriate to synchronize state with current remote objects without an infrastructure change.
B:Review whether to restore desired IaC attributes or update configuration deliberately to adopt the observed change. This relates to out-of-band drift detection in managed resource rather than the matching diagnosis-and-remediation pair required here. Check: Inspect terraform plan -refresh-only and distinguish state/output updates from normal planned infrastructure modifications. Then change: Apply a reviewed refresh-only plan when appropriate to synchronize state with current remote objects without an infrastructure change.
C:Inspect the backend configuration and state file location on each workstation to identify local state behavior. This relates to local backend path and exposure rather than the matching diagnosis-and-remediation pair required here. Check: Inspect terraform plan -refresh-only and distinguish state/output updates from normal planned infrastructure modifications. Then change: Apply a reviewed refresh-only plan when appropriate to synchronize state with current remote objects without an infrastructure change.
Question 600
While diagnosing a Terraform state or import issue in a staging workspace, the following condition occurs: Terraform init fails sporadically with a provider connectivity error, but its normal CLI output lacks sufficient context for investigating the failed request. The investigator must avoid unreviewed state writes. What should the engineer inspect FIRST to distinguish this issue from unrelated failures?
- Inspect the resource's provider selection, active credentials and which account owns the remote object.
- Inspect configuration import blocks, provider object IDs and candidate resource declarations for consistent address mapping.
- Inspect the failure mode and select an appropriate TF_LOG verbosity level while protecting credential-bearing log data.
- Check the TF_LOG environment variable and filesystem permissions for the requested log path.
Explanation
Correct Answer
C:Inspect the failure mode and select an appropriate TF_LOG verbosity level while protecting credential-bearing log data. Terraform logging through TF_LOG adds CLI/provider diagnostics; verbose traces may include sensitive operational information. A justified correction is: Temporarily set TF_LOG to a useful level such as DEBUG or TRACE and capture restricted diagnostic output for the failing command. This matters here because while diagnosing a Terraform state or import issue in a staging workspace, the following condition occurs: Terraform….
Incorrect Answers
A:Inspect the resource's provider selection, active credentials and which account owns the remote object. This inspects import source account and provider selection rather than the reported tf_log for troubleshooting provider and cli diagnostics issue. The decisive investigation is: Inspect the failure mode and select an appropriate TF_LOG verbosity level while protecting credential-bearing log data.
B:Inspect configuration import blocks, provider object IDs and candidate resource declarations for consistent address mapping. This inspects import blocks for reproducible adoption workflow rather than the reported tf_log for troubleshooting provider and cli diagnostics issue. The decisive investigation is: Inspect the failure mode and select an appropriate TF_LOG verbosity level while protecting credential-bearing log data.
D:Check the TF_LOG environment variable and filesystem permissions for the requested log path. This inspects tf_log_path requires enabled logging rather than the reported tf_log for troubleshooting provider and cli diagnostics issue. The decisive investigation is: Inspect the failure mode and select an appropriate TF_LOG verbosity level while protecting credential-bearing log data. This matters here because while diagnosing a Terraform state or import issue in a staging workspace, the following condition occurs: Terraform….