100% Latest & Updated HashiCorp Terraform Associate 004 Practice Test Questions, Exam Dumps & Verified Answers!
30 Days Free Updates, Instant Download!
Question 500
A Terraform platform team is coordinating 3 independent decisions. Workstream A: A release engineer needs the resource addresses Terraform currently manages without printing secrets from state. and Workstream B: A team considers keeping .terraform.lock.hcl in a secrets vault because it thinks the file is the primary infrastructure state store. and Workstream C: A firewall rule should be provisioned only after a policy attachment exists, but the rule's arguments do not reference that attachment. Select exactly 3 actions, one addressing each distinct workstream.
- Add an explicit depends_on referencing the policy attachment resource for the hidden operational dependency.
- Distinguish provider-version lock metadata from terraform.tfstate and protect the actual state through suitable backend controls.
- Use terraform state list to enumerate addresses in the selected state.
- Run terraform init in the root module directory to initialize backend, modules, and providers.
- Configure an appropriate supported remote backend with secure access and locking rather than emailing terraform.tfstate.
- Create a child module with declared input variables, resource blocks, and output values, then invoke it from a root module.
Explanation
Correct Answers
A:For the workstream in which a firewall rule should be provisioned only after a policy attachment exists, but the rule's arguments do not reference that attachment, use this action: Add an explicit depends_on referencing the policy attachment resource for the hidden operational dependency. depends_on expresses ordering when Terraform cannot infer it from attribute references. Verify: The dependency graph orders the attachment action before the dependent rule operation. Limitation: Explicit dependencies should be limited to real hidden dependencies; excessive depends_on can make plans conservative.
B:For the workstream in which a team considers keeping .terraform.lock.hcl in a secrets vault because it thinks the file is the primary infrastructure state store, use this action: Distinguish provider-version lock metadata from terraform.tfstate and protect the actual state through suitable backend controls. Provider dependency locking and infrastructure state solve different problems. Verify: Inspection shows the lock file describes plugin versions while state records resource attributes and bindings. Limitation: State may include confidential values even when CLI output hides sensitive variable contents.
C:For the workstream in which a release engineer needs the resource addresses Terraform currently manages without printing secrets from state, use this action: Use terraform state list to enumerate addresses in the selected state. State subcommands inspect Terraform's recorded managed bindings rather than formatting HCL. Verify: The command outputs the expected resource instance addresses for further inspection. Limitation: State list does not prove remote objects still exist or show every attribute's current value.
Incorrect Answers
D:This action is appropriate instead for a different, unlisted requirement: An engineer clones a Terraform repository and sees an error that provider plugins are not installed. It would be checked by: The .terraform working data and dependency lock file reflect successful initialization. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.
E:This action is appropriate instead for a different, unlisted requirement: A team's state file is stored on a laptop and must be shared across several engineers without copying it manually after every change. It would be checked by: Multiple team members read one central state snapshot and serialized operations when the backend supports locking. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.
F:This action is appropriate instead for a different, unlisted requirement: A team is packaging a repeated VPC pattern and wants a stable interface for internal consumers. It would be checked by: Consumers can pass environment-specific inputs and receive selected outputs without editing child internals. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.
Question 501
An infrastructure team faces this specific situation: An analyst needs to inspect one managed resource's recorded attributes and associated provider metadata during an incident. Which Terraform action most directly satisfies the requirement?
- Set TF_LOG and TF_LOG_PATH together, collect the protected log, then disable verbose logging.
- Use terraform state show ADDRESS or a carefully scoped terraform show output on the selected state.
- Set an appropriate TF_LOG level for the troubleshooting session and reproduce the error safely.
- Disable or lower TF_LOG after collecting the targeted diagnostic evidence.
Explanation
Correct Answer
B:Use terraform state show ADDRESS or a carefully scoped terraform show output on the selected state. State inspection reads Terraform's recorded snapshot; remote freshness requires refresh or plan. Verify: The selected resource's stored attributes and address are visible for diagnosis. Limitation: State output may contain secrets and may be stale relative to the latest remote settings.
Incorrect Answers
A:This is linked to a different situation: A CI team wants to preserve Terraform debug output to a controlled file for a short-lived investigation. There the relevant decision is: Set TF_LOG and TF_LOG_PATH together, collect the protected log, then disable verbose logging. For the question's actual requirement — An analyst needs to inspect one managed resource's recorded attributes and associated provider metadata during an incident. — the specifically relevant decision is: Use terraform state show ADDRESS or a carefully scoped terraform show output on the selected state. It would therefore not resolve or assess the case as stated.
C:This is linked to a different situation: A provider operation fails with an opaque authentication error and an engineer needs temporary, more detailed Terraform diagnostics. There the relevant decision is: Set an appropriate TF_LOG level for the troubleshooting session and reproduce the error safely. For the question's actual requirement — An analyst needs to inspect one managed resource's recorded attributes and associated provider metadata during an incident. — the specifically relevant decision is: Use terraform state show ADDRESS or a carefully scoped terraform show output on the selected state. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: An operator leaves TF_LOG=TRACE enabled in production for all runs and sees excessive potentially sensitive logs. There the relevant decision is: Disable or lower TF_LOG after collecting the targeted diagnostic evidence. For the question's actual requirement — An analyst needs to inspect one managed resource's recorded attributes and associated provider metadata during an incident. — the specifically relevant decision is: Use terraform state show ADDRESS or a carefully scoped terraform show output on the selected state. It would therefore not resolve or assess the case as stated.
Question 502
A reviewer is confirming a change for the following use case: An analyst needs to inspect one managed resource's recorded attributes and associated provider metadata during an incident. The implementation follows this approach: Use terraform state show ADDRESS or a carefully scoped terraform show output on the selected state. Which observation or acceptance test most directly verifies the intended result?
- Subsequent normal runs no longer emit verbose tracing to the same log destination.
- State gains the intended address and a reviewed plan evaluates remaining configuration differences.
- State inspection shows the imported instance at a single intended address.
- The selected resource's stored attributes and address are visible for diagnosis.
Explanation
Correct Answer
D:Acceptance evidence: The selected resource's stored attributes and address are visible for diagnosis. It validates the proposed action, use terraform state show ADDRESS or a carefully scoped terraform show output on the selected state, because state inspection reads Terraform's recorded snapshot; remote freshness requires refresh or plan. Remaining limitation: State output may contain secrets and may be stale relative to the latest remote settings.
Incorrect Answers
A:This is linked to a different situation: An operator leaves TF_LOG=TRACE enabled in production for all runs and sees excessive potentially sensitive logs. There the relevant acceptance is: Subsequent normal runs no longer emit verbose tracing to the same log destination. For the question's actual requirement — An analyst needs to inspect one managed resource's recorded attributes and associated provider metadata during an incident. — the specifically relevant acceptance is: The selected resource's stored attributes and address are visible for diagnosis. It would therefore not resolve or assess the case as stated.
B:This is linked to a different situation: A database already exists outside Terraform but needs to become managed under an explicit new resource address. There the relevant acceptance is: State gains the intended address and a reviewed plan evaluates remaining configuration differences. For the question's actual requirement — An analyst needs to inspect one managed resource's recorded attributes and associated provider metadata during an incident. — the specifically relevant acceptance is: The selected resource's stored attributes and address are visible for diagnosis. It would therefore not resolve or assess the case as stated.
C:This is linked to a different situation: An engineer is importing one cloud instance but attempts to assign the same remote object to two Terraform resource addresses. There the relevant acceptance is: State inspection shows the imported instance at a single intended address. For the question's actual requirement — An analyst needs to inspect one managed resource's recorded attributes and associated provider metadata during an incident. — the specifically relevant acceptance is: The selected resource's stored attributes and address are visible for diagnosis. It would therefore not resolve or assess the case as stated.
Question 503
Consider a proposed solution for this requirement: An analyst needs to inspect one managed resource's recorded attributes and associated provider metadata during an incident. The team plans to do the following: Use terraform state show ADDRESS or a carefully scoped terraform show output on the selected state. Which limitation or operational caveat must remain in the review?
- Verbose logs can contain confidential values and should be handled as sensitive evidence.
- State output may contain secrets and may be stale relative to the latest remote settings.
- Multiple bindings to the same real object can produce unpredictable lifecycle behavior.
- Generated configuration still requires technical review and may include values unsuitable for production.
Explanation
Correct Answer
B:The limitation is state output may contain secrets and may be stale relative to the latest remote settings. The proposed change is use terraform state show ADDRESS or a carefully scoped terraform show output on the selected state. Validate it by checking the selected resource's stored attributes and address are visible for diagnosis. State inspection reads Terraform's recorded snapshot; remote freshness requires refresh or plan.
Incorrect Answers
A:This is linked to a different situation: A provider operation fails with an opaque authentication error and an engineer needs temporary, more detailed Terraform diagnostics. There the relevant limitation is: Verbose logs can contain confidential values and should be handled as sensitive evidence. For the question's actual requirement — An analyst needs to inspect one managed resource's recorded attributes and associated provider metadata during an incident. — the specifically relevant limitation is: State output may contain secrets and may be stale relative to the latest remote settings. It would therefore not resolve or assess the case as stated.
C:This is linked to a different situation: An engineer is importing one cloud instance but attempts to assign the same remote object to two Terraform resource addresses. There the relevant limitation is: Multiple bindings to the same real object can produce unpredictable lifecycle behavior. For the question's actual requirement — An analyst needs to inspect one managed resource's recorded attributes and associated provider metadata during an incident. — the specifically relevant limitation is: State output may contain secrets and may be stale relative to the latest remote settings. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: A new import block is committed for a resource whose configuration is incomplete and the team wants a review before apply. There the relevant limitation is: Generated configuration still requires technical review and may include values unsuitable for production. For the question's actual requirement — An analyst needs to inspect one managed resource's recorded attributes and associated provider metadata during an incident. — the specifically relevant limitation is: State output may contain secrets and may be stale relative to the latest remote settings. It would therefore not resolve or assess the case as stated.
Question 504
The team is reviewing a Terraform implementation for this case: An analyst needs to inspect one managed resource's recorded attributes and associated provider metadata during an incident. Which tempting assumption would be specifically incorrect for this proposed implementation?
- Assume declaring an import block alone completes all resource configuration accurately.
- Assume terraform state show is a live provider API query that always bypasses stored state.
- Set only TF_LOG_PATH and assume Terraform automatically starts writing full debug events.
- Treat verbose Terraform tracing as a harmless permanent production observability default.
Explanation
Correct Answer
B:Reject the assumption: Assume terraform state show is a live provider API query that always bypasses stored state. Instead, use terraform state show ADDRESS or a carefully scoped terraform show output on the selected state. State inspection reads Terraform's recorded snapshot; remote freshness requires refresh or plan. Acceptance evidence: The selected resource's stored attributes and address are visible for diagnosis.
Incorrect Answers
A:This is linked to a different situation: A new import block is committed for a resource whose configuration is incomplete and the team wants a review before apply. There the relevant misconception is: Assume declaring an import block alone completes all resource configuration accurately. For the question's actual requirement — An analyst needs to inspect one managed resource's recorded attributes and associated provider metadata during an incident. — the specifically relevant misconception is: Assume terraform state show is a live provider API query that always bypasses stored state. It would therefore not resolve or assess the case as stated.
C:This is linked to a different situation: A CI team wants to preserve Terraform debug output to a controlled file for a short-lived investigation. There the relevant misconception is: Set only TF_LOG_PATH and assume Terraform automatically starts writing full debug events. For the question's actual requirement — An analyst needs to inspect one managed resource's recorded attributes and associated provider metadata during an incident. — the specifically relevant misconception is: Assume terraform state show is a live provider API query that always bypasses stored state. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: An operator leaves TF_LOG=TRACE enabled in production for all runs and sees excessive potentially sensitive logs. There the relevant misconception is: Treat verbose Terraform tracing as a harmless permanent production observability default. For the question's actual requirement — An analyst needs to inspect one managed resource's recorded attributes and associated provider metadata during an incident. — the specifically relevant misconception is: Assume terraform state show is a live provider API query that always bypasses stored state. It would therefore not resolve or assess the case as stated.
Question 505
A Terraform platform team is coordinating 2 independent decisions. Workstream A: An analyst needs to inspect one managed resource's recorded attributes and associated provider metadata during an incident. and Workstream B: A newly hired engineer has a reviewed HCL repository but has not yet prepared its providers or backend. Select exactly 2 actions, one addressing each distinct workstream.
- Use the cloud integration block for workspace mapping and authenticate with terraform login securely.
- Declare resources through separate compatible providers in one Terraform configuration, with references for dependencies.
- Use terraform state show ADDRESS or a carefully scoped terraform show output on the selected state.
- Initialize the working directory, inspect a plan, and only then perform an authorized apply.
- Create a child module with declared input variables, resource blocks, and output values, then invoke it from a root module.
Explanation
Correct Answers
C:For the workstream in which an analyst needs to inspect one managed resource's recorded attributes and associated provider metadata during an incident, use this action: Use terraform state show ADDRESS or a carefully scoped terraform show output on the selected state. State inspection reads Terraform's recorded snapshot; remote freshness requires refresh or plan. Verify: The selected resource's stored attributes and address are visible for diagnosis. Limitation: State output may contain secrets and may be stale relative to the latest remote settings.
D:For the workstream in which a newly hired engineer has a reviewed HCL repository but has not yet prepared its providers or backend, use this action: Initialize the working directory, inspect a plan, and only then perform an authorized apply. The standard write-init-plan-apply workflow separates preparation, preview, and execution. Verify: The initialization succeeds and the reviewed plan enumerates proposed actions before change execution. Limitation: Commands may still fail on missing credentials, invalid cloud quotas, or forbidden API actions.
Incorrect Answers
A:This option addresses a separate requirement: A local Terraform root must be connected to a specific HCP Terraform workspace without storing an API token in version control. Evidence for that other requirement would be cLI commands authenticate to the correct HCP organization/workspace and work with managed remote state; neither listed workstream asks for it.
B:This option addresses a separate requirement: A logistics firm needs a private data-center virtual machine and a public-cloud DNS record managed from one reviewed release. Evidence for that other requirement would be a single plan lists the intended private and public resource actions under their respective providers; neither listed workstream asks for it.
E:This option addresses a separate requirement: A team is packaging a repeated VPC pattern and wants a stable interface for internal consumers. Evidence for that other requirement would be consumers can pass environment-specific inputs and receive selected outputs without editing child internals; neither listed workstream asks for it.
Question 506
An infrastructure team faces this specific situation: An engineer wants a machine-readable view of the current Terraform state while building an inventory report. Which Terraform action most directly satisfies the requirement?
- Disable or lower TF_LOG after collecting the targeted diagnostic evidence.
- Use terraform show -json on the state or saved plan with proper access controls.
- Write a matching resource declaration and use an import block or terraform import with the real object identifier.
- Generate and review a plan for the import block, optionally using supported configuration generation where appropriate.
Explanation
Correct Answer
B:Use terraform show -json on the state or saved plan with proper access controls. JSON inspection supports automation but does not remove security obligations around state data. Verify: The JSON structure can be parsed for relevant addresses and outputs by authorized tooling. Limitation: Machine-readable state and plans may expose sensitive values and should not be publicly stored.
Incorrect Answers
A:This is linked to a different situation: An operator leaves TF_LOG=TRACE enabled in production for all runs and sees excessive potentially sensitive logs. There the relevant decision is: Disable or lower TF_LOG after collecting the targeted diagnostic evidence. For the question's actual requirement — An engineer wants a machine-readable view of the current Terraform state while building an inventory report. — the specifically relevant decision is: Use terraform show -json on the state or saved plan with proper access controls. It would therefore not resolve or assess the case as stated.
C:This is linked to a different situation: A database already exists outside Terraform but needs to become managed under an explicit new resource address. There the relevant decision is: Write a matching resource declaration and use an import block or terraform import with the real object identifier. For the question's actual requirement — An engineer wants a machine-readable view of the current Terraform state while building an inventory report. — the specifically relevant decision is: Use terraform show -json on the state or saved plan with proper access controls. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: A new import block is committed for a resource whose configuration is incomplete and the team wants a review before apply. There the relevant decision is: Generate and review a plan for the import block, optionally using supported configuration generation where appropriate. For the question's actual requirement — An engineer wants a machine-readable view of the current Terraform state while building an inventory report. — the specifically relevant decision is: Use terraform show -json on the state or saved plan with proper access controls. It would therefore not resolve or assess the case as stated.
Question 507
A reviewer is confirming a change for the following use case: An engineer wants a machine-readable view of the current Terraform state while building an inventory report. The implementation follows this approach: Use terraform show -json on the state or saved plan with proper access controls. Which observation or acceptance test most directly verifies the intended result?
- The JSON structure can be parsed for relevant addresses and outputs by authorized tooling.
- State inspection shows the imported instance at a single intended address.
- State gains the intended address and a reviewed plan evaluates remaining configuration differences.
- The plan shows import actions and any additional changes needed to align desired configuration.
Explanation
Correct Answer
A:Acceptance evidence: The JSON structure can be parsed for relevant addresses and outputs by authorized tooling. It validates the proposed action, use terraform show -json on the state or saved plan with proper access controls, because jSON inspection supports automation but does not remove security obligations around state data. Remaining limitation: Machine-readable state and plans may expose sensitive values and should not be publicly stored.
Incorrect Answers
B:This is linked to a different situation: An engineer is importing one cloud instance but attempts to assign the same remote object to two Terraform resource addresses. There the relevant acceptance is: State inspection shows the imported instance at a single intended address. For the question's actual requirement — An engineer wants a machine-readable view of the current Terraform state while building an inventory report. — the specifically relevant acceptance is: The JSON structure can be parsed for relevant addresses and outputs by authorized tooling. It would therefore not resolve or assess the case as stated.
C:This is linked to a different situation: A database already exists outside Terraform but needs to become managed under an explicit new resource address. There the relevant acceptance is: State gains the intended address and a reviewed plan evaluates remaining configuration differences. For the question's actual requirement — An engineer wants a machine-readable view of the current Terraform state while building an inventory report. — the specifically relevant acceptance is: The JSON structure can be parsed for relevant addresses and outputs by authorized tooling. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: A new import block is committed for a resource whose configuration is incomplete and the team wants a review before apply. There the relevant acceptance is: The plan shows import actions and any additional changes needed to align desired configuration. For the question's actual requirement — An engineer wants a machine-readable view of the current Terraform state while building an inventory report. — the specifically relevant acceptance is: The JSON structure can be parsed for relevant addresses and outputs by authorized tooling. It would therefore not resolve or assess the case as stated.
Question 508
Consider a proposed solution for this requirement: An engineer wants a machine-readable view of the current Terraform state while building an inventory report. The team plans to do the following: Use terraform show -json on the state or saved plan with proper access controls. Which limitation or operational caveat must remain in the review?
- Machine-readable state and plans may expose sensitive values and should not be publicly stored.
- Disabling logs prevents future emission but does not erase previously collected sensitive log files.
- Generated configuration still requires technical review and may include values unsuitable for production.
- Multiple bindings to the same real object can produce unpredictable lifecycle behavior.
Explanation
Correct Answer
A:The limitation is machine-readable state and plans may expose sensitive values and should not be publicly stored. The proposed change is use terraform show -json on the state or saved plan with proper access controls. Validate it by checking the JSON structure can be parsed for relevant addresses and outputs by authorized tooling. JSON inspection supports automation but does not remove security obligations around state data.
Incorrect Answers
B:This is linked to a different situation: An operator leaves TF_LOG=TRACE enabled in production for all runs and sees excessive potentially sensitive logs. There the relevant limitation is: Disabling logs prevents future emission but does not erase previously collected sensitive log files. For the question's actual requirement — An engineer wants a machine-readable view of the current Terraform state while building an inventory report. — the specifically relevant limitation is: Machine-readable state and plans may expose sensitive values and should not be publicly stored. It would therefore not resolve or assess the case as stated.
C:This is linked to a different situation: A new import block is committed for a resource whose configuration is incomplete and the team wants a review before apply. There the relevant limitation is: Generated configuration still requires technical review and may include values unsuitable for production. For the question's actual requirement — An engineer wants a machine-readable view of the current Terraform state while building an inventory report. — the specifically relevant limitation is: Machine-readable state and plans may expose sensitive values and should not be publicly stored. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: An engineer is importing one cloud instance but attempts to assign the same remote object to two Terraform resource addresses. There the relevant limitation is: Multiple bindings to the same real object can produce unpredictable lifecycle behavior. For the question's actual requirement — An engineer wants a machine-readable view of the current Terraform state while building an inventory report. — the specifically relevant limitation is: Machine-readable state and plans may expose sensitive values and should not be publicly stored. It would therefore not resolve or assess the case as stated.
Question 509
The team is reviewing a Terraform implementation for this case: An engineer wants a machine-readable view of the current Terraform state while building an inventory report. Which tempting assumption would be specifically incorrect for this proposed implementation?
- Declare the database in HCL and assume the next apply will adopt any same-named existing object.
- Set an unrelated TF_VAR value and expect it to turn on Terraform CLI tracing.
- Assume declaring an import block alone completes all resource configuration accurately.
- Upload a complete terraform show -json result to a public dashboard without reviewing secret exposure.
Explanation
Correct Answer
D:Reject the assumption: Upload a complete terraform show -json result to a public dashboard without reviewing secret exposure. Instead, use terraform show -json on the state or saved plan with proper access controls. JSON inspection supports automation but does not remove security obligations around state data. Acceptance evidence: The JSON structure can be parsed for relevant addresses and outputs by authorized tooling.
Incorrect Answers
A:This is linked to a different situation: A database already exists outside Terraform but needs to become managed under an explicit new resource address. There the relevant misconception is: Declare the database in HCL and assume the next apply will adopt any same-named existing object. For the question's actual requirement — An engineer wants a machine-readable view of the current Terraform state while building an inventory report. — the specifically relevant misconception is: Upload a complete terraform show -json result to a public dashboard without reviewing secret exposure. It would therefore not resolve or assess the case as stated.
B:This is linked to a different situation: A provider operation fails with an opaque authentication error and an engineer needs temporary, more detailed Terraform diagnostics. There the relevant misconception is: Set an unrelated TF_VAR value and expect it to turn on Terraform CLI tracing. For the question's actual requirement — An engineer wants a machine-readable view of the current Terraform state while building an inventory report. — the specifically relevant misconception is: Upload a complete terraform show -json result to a public dashboard without reviewing secret exposure. It would therefore not resolve or assess the case as stated.
C:This is linked to a different situation: A new import block is committed for a resource whose configuration is incomplete and the team wants a review before apply. There the relevant misconception is: Assume declaring an import block alone completes all resource configuration accurately. For the question's actual requirement — An engineer wants a machine-readable view of the current Terraform state while building an inventory report. — the specifically relevant misconception is: Upload a complete terraform show -json result to a public dashboard without reviewing secret exposure. It would therefore not resolve or assess the case as stated.
Question 510
A Terraform platform team is coordinating 3 independent decisions. Workstream A: An engineer wants a machine-readable view of the current Terraform state while building an inventory report. and Workstream B: A nightly job wants to detect unexpected pending Terraform changes but should not mutate production resources. and Workstream C: A team's database must never be accidentally destroyed by a routine Terraform plan while its resource declaration remains managed. Select exactly 3 actions, one addressing each distinct workstream.
- Set lifecycle prevent_destroy and verify the protection is exercised by a proposed destructive plan.
- Use terraform show -json on the state or saved plan with proper access controls.
- Run a speculative terraform plan with the desired inputs and examine its proposed changes.
- Set provider = aws.secondary on that resource, referencing the aliased provider configuration.
- Create an appropriately scoped HCP Terraform variable set applied to those project workspaces.
- Reference the local path with source = "./modules/security" inside the module block.
Explanation
Correct Answers
A:For the workstream in which a team's database must never be accidentally destroyed by a routine Terraform plan while its resource declaration remains managed, use this action: Set lifecycle prevent_destroy and verify the protection is exercised by a proposed destructive plan. prevent_destroy rejects destructive plans while its rule is present in managed configuration. Verify: A plan that would destroy the configured protected resource is rejected with an error. Limitation: Removing the entire resource block also removes this configuration-based guard; it is not permanent cloud-side deletion protection.
B:For the workstream in which an engineer wants a machine-readable view of the current Terraform state while building an inventory report, use this action: Use terraform show -json on the state or saved plan with proper access controls. JSON inspection supports automation but does not remove security obligations around state data. Verify: The JSON structure can be parsed for relevant addresses and outputs by authorized tooling. Limitation: Machine-readable state and plans may expose sensitive values and should not be publicly stored.
C:For the workstream in which a nightly job wants to detect unexpected pending Terraform changes but should not mutate production resources, use this action: Run a speculative terraform plan with the desired inputs and examine its proposed changes. Plan previews reconciliation; apply would perform changes. Verify: The command returns a plan showing resource actions without executing them. Limitation: A speculative plan can become stale and must not be mistaken for an approval to apply.
Incorrect Answers
D:This action is appropriate instead for a different, unlisted requirement: A configuration has two aliases of the same cloud provider and both use different regions; one resource must be created outside the default region. It would be checked by: The planned resource address resolves through the secondary provider while unqualified resources use the default. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.
E:This action is appropriate instead for a different, unlisted requirement: A platform administrator must reuse one nonsecret provider configuration variable across multiple workspaces in the same HCP project. It would be checked by: New and existing workspaces in the project receive the intended shared variable. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.
F:This action is appropriate instead for a different, unlisted requirement: A security group module lives in the local modules/security directory of the same versioned repository. It would be checked by: Terraform reads the local child module without fetching it from a remote registry. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.
HashiCorp Certified: Terraform Associate (004) (Terraform Associate 004) Practice Tests