100% Latest & Updated HashiCorp Terraform Associate 004 Practice Test Questions, Exam Dumps & Verified Answers!
30 Days Free Updates, Instant Download!
Question 300
A Terraform platform team is coordinating 3 independent decisions. Workstream A: A managed resource's tag is updated by an external compliance agent, and Terraform must not revert only that tag on every plan. and Workstream B: A new import block is committed for a resource whose configuration is incomplete and the team wants a review before apply. and Workstream C: Two engineers share one project but each stores a different local state file and independently sees new resources in their plans. Select exactly 3 actions, one addressing each distinct workstream.
- Use lifecycle ignore_changes for the specifically shared tag attribute after agreeing which system owns it.
- Move to an appropriate shared backend with concurrency controls so both plans use the same authoritative state.
- Save the reviewed plan with terraform plan -out=release.tfplan and apply that saved plan file.
- Generate and review a plan for the import block, optionally using supported configuration generation where appropriate.
- Configure separate HCP workspaces with correct working directories and path-based VCS run triggers.
- Inspect terraform plan -replace=ADDRESS and review any downstream dependencies before applying.
Explanation
Correct Answers
A:For the workstream in which a managed resource's tag is updated by an external compliance agent, and Terraform must not revert only that tag on every plan, use this action: Use lifecycle ignore_changes for the specifically shared tag attribute after agreeing which system owns it. ignore_changes narrows drift reconciliation for selected attributes during updates. Verify: Subsequent plans avoid proposing updates solely because the ignored tag changed outside Terraform. Limitation: Ignore rules do not ignore the attribute at initial resource creation and can hide meaningful drift if used too broadly.
B:For the workstream in which two engineers share one project but each stores a different local state file and independently sees new resources in their plans, use this action: Move to an appropriate shared backend with concurrency controls so both plans use the same authoritative state. State carries the managed resource bindings, so isolated state files can cause conflicting views. Verify: Both operators observe the same resource addresses and coordinated state updates. Limitation: A backend cannot reconcile genuinely conflicting code branches or permissions by itself.
D:For the workstream in which a new import block is committed for a resource whose configuration is incomplete and the team wants a review before apply, use this action: Generate and review a plan for the import block, optionally using supported configuration generation where appropriate. Declarative imports let adoption be planned and reviewed within the normal Terraform lifecycle. Verify: The plan shows import actions and any additional changes needed to align desired configuration. Limitation: Generated configuration still requires technical review and may include values unsuitable for production.
Incorrect Answers
C:This action is appropriate instead for a different, unlisted requirement: A release pipeline needs to ensure the exact reviewed plan, not a newly calculated one, is executed after approval. It would be checked by: The apply consumes the named plan artifact and uses its previously selected actions and variable values. 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 company uses one VCS monorepo for several independent Terraform root directories and wants each to run only when relevant files change. It would be checked by: Changing one directory triggers its intended workspace without spurious unrelated runs. 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 deployment operator needs to replace a single degraded instance deliberately while keeping its resource address. It would be checked by: The proposed plan marks that particular resource instance for replacement. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.
Question 301
An infrastructure team faces this specific situation: A reusable module needs to reject a user-provided CIDR that is outside a documented allowed address family. Which Terraform action most directly satisfies the requirement?
- Reference the selected data source attribute in the managed resource's image argument.
- Index the resource collection by its actual for_each key rather than assuming numeric list positions.
- Use a for expression with lower() to derive normalized names from the input collection.
- Add a variable validation block with a clear condition and error message appropriate for the supported expression.
Explanation
Correct Answer
D:Add a variable validation block with a clear condition and error message appropriate for the supported expression. Variable conditions verify value requirements beyond primitive type checking. Verify: Planning with an invalid input produces a useful validation error before unwanted resource operations. Limitation: Custom validation must reflect the true policy; a syntactically valid condition may be overly broad or restrictive.
Incorrect Answers
A:This is linked to a different situation: A module uses a provider data source to find the newest image and a resource block to launch a VM from its returned identifier. There the relevant decision is: Reference the selected data source attribute in the managed resource's image argument. For the question's actual requirement — A reusable module needs to reject a user-provided CIDR that is outside a documented allowed address family. — the specifically relevant decision is: Add a variable validation block with a clear condition and error message appropriate for the supported expression. It would therefore not resolve or assess the case as stated.
B:This is linked to a different situation: A module uses for_each on a map of regions and must output one subnet ID for the us-east-1 instance. There the relevant decision is: Index the resource collection by its actual for_each key rather than assuming numeric list positions. For the question's actual requirement — A reusable module needs to reject a user-provided CIDR that is outside a documented allowed address family. — the specifically relevant decision is: Add a variable validation block with a clear condition and error message appropriate for the supported expression. It would therefore not resolve or assess the case as stated.
C:This is linked to a different situation: A pipeline produces a list of service names with inconsistent letter casing and needs normalized DNS labels. There the relevant decision is: Use a for expression with lower() to derive normalized names from the input collection. For the question's actual requirement — A reusable module needs to reject a user-provided CIDR that is outside a documented allowed address family. — the specifically relevant decision is: Add a variable validation block with a clear condition and error message appropriate for the supported expression. It would therefore not resolve or assess the case as stated.
Question 302
A reviewer is confirming a change for the following use case: A reusable module needs to reject a user-provided CIDR that is outside a documented allowed address family. The implementation follows this approach: Add a variable validation block with a clear condition and error message appropriate for the supported expression. Which observation or acceptance test most directly verifies the intended result?
- The root plan evaluates a public module output without reaching into private child locals.
- Subsequent plans avoid proposing updates solely because the ignored tag changed outside Terraform.
- Terraform's graph records the dependency and plans the database with the correct group identifier.
- Planning with an invalid input produces a useful validation error before unwanted resource operations.
Explanation
Correct Answer
D:Acceptance evidence: Planning with an invalid input produces a useful validation error before unwanted resource operations. It validates the proposed action, add a variable validation block with a clear condition and error message appropriate for the supported expression, because variable conditions verify value requirements beyond primitive type checking. Remaining limitation: Custom validation must reflect the true policy; a syntactically valid condition may be overly broad or restrictive.
Incorrect Answers
A:This is linked to a different situation: A resource argument refers to an output produced by a child module, but the author attempts to read the child's internal local name directly. There the relevant acceptance is: The root plan evaluates a public module output without reaching into private child locals. For the question's actual requirement — A reusable module needs to reject a user-provided CIDR that is outside a documented allowed address family. — the specifically relevant acceptance is: Planning with an invalid input produces a useful validation error before unwanted resource operations. It would therefore not resolve or assess the case as stated.
B:This is linked to a different situation: A managed resource's tag is updated by an external compliance agent, and Terraform must not revert only that tag on every plan. There the relevant acceptance is: Subsequent plans avoid proposing updates solely because the ignored tag changed outside Terraform. For the question's actual requirement — A reusable module needs to reject a user-provided CIDR that is outside a documented allowed address family. — the specifically relevant acceptance is: Planning with an invalid input produces a useful validation error before unwanted resource operations. It would therefore not resolve or assess the case as stated.
C:This is linked to a different situation: A database security group must be passed into a managed database resource without copying IDs into hardcoded variables. There the relevant acceptance is: Terraform's graph records the dependency and plans the database with the correct group identifier. For the question's actual requirement — A reusable module needs to reject a user-provided CIDR that is outside a documented allowed address family. — the specifically relevant acceptance is: Planning with an invalid input produces a useful validation error before unwanted resource operations. It would therefore not resolve or assess the case as stated.
Question 303
Consider a proposed solution for this requirement: A reusable module needs to reject a user-provided CIDR that is outside a documented allowed address family. The team plans to do the following: Add a variable validation block with a clear condition and error message appropriate for the supported expression. Which limitation or operational caveat must remain in the review?
- Custom validation must reflect the true policy; a syntactically valid condition may be overly broad or restrictive.
- An automatically changing latest-image lookup may propose later VM replacements depending on resource schema.
- An attribute may be unknown until apply, but Terraform can still preserve the dependency graph.
- Converting a shared data lookup to a managed resource demands an ownership and import decision.
Explanation
Correct Answer
A:The limitation is custom validation must reflect the true policy; a syntactically valid condition may be overly broad or restrictive. The proposed change is add a variable validation block with a clear condition and error message appropriate for the supported expression. Validate it by checking planning with an invalid input produces a useful validation error before unwanted resource operations. Variable conditions verify value requirements beyond primitive type checking.
Incorrect Answers
B:This is linked to a different situation: A module uses a provider data source to find the newest image and a resource block to launch a VM from its returned identifier. There the relevant limitation is: An automatically changing latest-image lookup may propose later VM replacements depending on resource schema. For the question's actual requirement — A reusable module needs to reject a user-provided CIDR that is outside a documented allowed address family. — the specifically relevant limitation is: Custom validation must reflect the true policy; a syntactically valid condition may be overly broad or restrictive. It would therefore not resolve or assess the case as stated.
C:This is linked to a different situation: A database security group must be passed into a managed database resource without copying IDs into hardcoded variables. There the relevant limitation is: An attribute may be unknown until apply, but Terraform can still preserve the dependency graph. For the question's actual requirement — A reusable module needs to reject a user-provided CIDR that is outside a documented allowed address family. — the specifically relevant limitation is: Custom validation must reflect the true policy; a syntactically valid condition may be overly broad or restrictive. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: An engineer sees a data block representing a preexisting DNS zone and wants to delete that DNS zone with terraform destroy. There the relevant limitation is: Converting a shared data lookup to a managed resource demands an ownership and import decision. For the question's actual requirement — A reusable module needs to reject a user-provided CIDR that is outside a documented allowed address family. — the specifically relevant limitation is: Custom validation must reflect the true policy; a syntactically valid condition may be overly broad or restrictive. It would therefore not resolve or assess the case as stated.
Question 304
The team is reviewing a Terraform implementation for this case: A reusable module needs to reject a user-provided CIDR that is outside a documented allowed address family. Which tempting assumption would be specifically incorrect for this proposed implementation?
- Pass a password to an ordinary tracked resource attribute and expect Terraform to erase it from all artifacts.
- Use an output block to accept a runtime port supplied by the caller.
- Expect the type string alone to reject a semantically invalid CIDR string.
- Hardcode a stale image identifier while retaining a data source solely as decoration.
Explanation
Correct Answer
C:Reject the assumption: Expect the type string alone to reject a semantically invalid CIDR string. Instead, add a variable validation block with a clear condition and error message appropriate for the supported expression. Variable conditions verify value requirements beyond primitive type checking. Acceptance evidence: Planning with an invalid input produces a useful validation error before unwanted resource operations.
Incorrect Answers
A:This is linked to a different situation: A database API supports a write-only password argument and the team must avoid persisting the initial password to state. There the relevant misconception is: Pass a password to an ordinary tracked resource attribute and expect Terraform to erase it from all artifacts. For the question's actual requirement — A reusable module needs to reject a user-provided CIDR that is outside a documented allowed address family. — the specifically relevant misconception is: Expect the type string alone to reject a semantically invalid CIDR string. It would therefore not resolve or assess the case as stated.
B:This is linked to a different situation: A deployment needs separate port numbers per environment and a documented default for developer sandboxes. There the relevant misconception is: Use an output block to accept a runtime port supplied by the caller. For the question's actual requirement — A reusable module needs to reject a user-provided CIDR that is outside a documented allowed address family. — the specifically relevant misconception is: Expect the type string alone to reject a semantically invalid CIDR string. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: A module uses a provider data source to find the newest image and a resource block to launch a VM from its returned identifier. There the relevant misconception is: Hardcode a stale image identifier while retaining a data source solely as decoration. For the question's actual requirement — A reusable module needs to reject a user-provided CIDR that is outside a documented allowed address family. — the specifically relevant misconception is: Expect the type string alone to reject a semantically invalid CIDR string. It would therefore not resolve or assess the case as stated.
Question 305
A Terraform platform team is coordinating 2 independent decisions. Workstream A: A reusable module needs to reject a user-provided CIDR that is outside a documented allowed address family. and Workstream B: A release engineer needs the resource addresses Terraform currently manages without printing secrets from state. Select exactly 2 actions, one addressing each distinct workstream.
- Review the generated plan and approve the apply prompt only if the changes are intended.
- Refer to the indexed module instance, such as module.worker[1].endpoint, with an appropriate count expression.
- Use the provider's supported environment or workload identity authentication mechanism rather than embedding credential literals.
- Use terraform state list to enumerate addresses in the selected state.
- Add a variable validation block with a clear condition and error message appropriate for the supported expression.
Explanation
Correct Answers
D: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.
E:For the workstream in which a reusable module needs to reject a user-provided CIDR that is outside a documented allowed address family, use this action: Add a variable validation block with a clear condition and error message appropriate for the supported expression. Variable conditions verify value requirements beyond primitive type checking. Verify: Planning with an invalid input produces a useful validation error before unwanted resource operations. Limitation: Custom validation must reflect the true policy; a syntactically valid condition may be overly broad or restrictive.
Incorrect Answers
A:This option addresses a separate requirement: A developer executes terraform apply interactively without a plan file and sees a proposed change summary. Evidence for that other requirement would be the apply command waits for confirmation before changing resources in normal interactive use; neither listed workstream asks for it.
B:This option addresses a separate requirement: A deployment calls a reusable module with count = 3 and must reference the output of only the second instance. Evidence for that other requirement would be the plan resolves the output for the intended counted module instance; neither listed workstream asks for it.
C:This option addresses a separate requirement: A newly introduced provider plugin needs credentials but the team wants to avoid including long-lived secrets in tracked files. Evidence for that other requirement would be the provider authenticates through the supported runtime identity without secrets appearing in committed configuration; neither listed workstream asks for it.
Question 306
An infrastructure team faces this specific situation: A managed service should not continue to downstream provisioning if the returned endpoint has an invalid structure. Which Terraform action most directly satisfies the requirement?
- Expose the needed value through an output block in the child and reference module.child.output_name.
- Pass values through appropriate .tfvars files or documented TF_VAR_name environment variables.
- Reference the security group resource attribute directly from the database argument.
- Define a resource postcondition that validates the resulting endpoint before dependent resources proceed.
Explanation
Correct Answer
D:Define a resource postcondition that validates the resulting endpoint before dependent resources proceed. Resource postconditions assert properties of results after relevant operations. Verify: A failing postcondition signals an error and prevents downstream dependent actions. Limitation: Postconditions evaluate values at the appropriate stage; a result that is unknown at plan may be checked later.
Incorrect Answers
A:This is linked to a different situation: A resource argument refers to an output produced by a child module, but the author attempts to read the child's internal local name directly. There the relevant decision is: Expose the needed value through an output block in the child and reference module.child.output_name. For the question's actual requirement — A managed service should not continue to downstream provisioning if the returned endpoint has an invalid structure. — the specifically relevant decision is: Define a resource postcondition that validates the resulting endpoint before dependent resources proceed. It would therefore not resolve or assess the case as stated.
B:This is linked to a different situation: A deployment job must supply different nonsecret inputs for each pipeline run without editing source-controlled HCL. There the relevant decision is: Pass values through appropriate .tfvars files or documented TF_VAR_name environment variables. For the question's actual requirement — A managed service should not continue to downstream provisioning if the returned endpoint has an invalid structure. — the specifically relevant decision is: Define a resource postcondition that validates the resulting endpoint before dependent resources proceed. It would therefore not resolve or assess the case as stated.
C:This is linked to a different situation: A database security group must be passed into a managed database resource without copying IDs into hardcoded variables. There the relevant decision is: Reference the security group resource attribute directly from the database argument. For the question's actual requirement — A managed service should not continue to downstream provisioning if the returned endpoint has an invalid structure. — the specifically relevant decision is: Define a resource postcondition that validates the resulting endpoint before dependent resources proceed. It would therefore not resolve or assess the case as stated.
Question 307
A reviewer is confirming a change for the following use case: A managed service should not continue to downstream provisioning if the returned endpoint has an invalid structure. The implementation follows this approach: Define a resource postcondition that validates the resulting endpoint before dependent resources proceed. Which observation or acceptance test most directly verifies the intended result?
- Terraform's graph records the dependency and plans the database with the correct group identifier.
- Plan distinguishes a create action from a read-only query of the existing network.
- The resource operation consumes the password while the Terraform plan and state omit the write-only value.
- A failing postcondition signals an error and prevents downstream dependent actions.
Explanation
Correct Answer
D:Acceptance evidence: A failing postcondition signals an error and prevents downstream dependent actions. It validates the proposed action, define a resource postcondition that validates the resulting endpoint before dependent resources proceed, because resource postconditions assert properties of results after relevant operations. Remaining limitation: Postconditions evaluate values at the appropriate stage; a result that is unknown at plan may be checked later.
Incorrect Answers
A:This is linked to a different situation: A database security group must be passed into a managed database resource without copying IDs into hardcoded variables. There the relevant acceptance is: Terraform's graph records the dependency and plans the database with the correct group identifier. For the question's actual requirement — A managed service should not continue to downstream provisioning if the returned endpoint has an invalid structure. — the specifically relevant acceptance is: A failing postcondition signals an error and prevents downstream dependent actions. It would therefore not resolve or assess the case as stated.
B:This is linked to a different situation: A web team must create a new load balancer and also look up an existing shared network ID managed by another team. There the relevant acceptance is: Plan distinguishes a create action from a read-only query of the existing network. For the question's actual requirement — A managed service should not continue to downstream provisioning if the returned endpoint has an invalid structure. — the specifically relevant acceptance is: A failing postcondition signals an error and prevents downstream dependent actions. It would therefore not resolve or assess the case as stated.
C:This is linked to a different situation: A database API supports a write-only password argument and the team must avoid persisting the initial password to state. There the relevant acceptance is: The resource operation consumes the password while the Terraform plan and state omit the write-only value. For the question's actual requirement — A managed service should not continue to downstream provisioning if the returned endpoint has an invalid structure. — the specifically relevant acceptance is: A failing postcondition signals an error and prevents downstream dependent actions. It would therefore not resolve or assess the case as stated.
Question 308
Consider a proposed solution for this requirement: A managed service should not continue to downstream provisioning if the returned endpoint has an invalid structure. The team plans to do the following: Define a resource postcondition that validates the resulting endpoint before dependent resources proceed. Which limitation or operational caveat must remain in the review?
- An object type is not interchangeable with any arbitrary map if its declared attributes differ.
- Postconditions evaluate values at the appropriate stage; a result that is unknown at plan may be checked later.
- Defaults should not embed production secrets or bypass review of production-specific values.
- sensitive primarily redacts normal CLI display; it does not by itself exclude a value from state.
Explanation
Correct Answer
B:The limitation is postconditions evaluate values at the appropriate stage; a result that is unknown at plan may be checked later. The proposed change is define a resource postcondition that validates the resulting endpoint before dependent resources proceed. Validate it by checking a failing postcondition signals an error and prevents downstream dependent actions. Resource postconditions assert properties of results after relevant operations.
Incorrect Answers
A:This is linked to a different situation: A developer defines a subnet inventory in which every subnet has cidr, zone, and public attributes, and needs reliable shape checking. There the relevant limitation is: An object type is not interchangeable with any arbitrary map if its declared attributes differ. For the question's actual requirement — A managed service should not continue to downstream provisioning if the returned endpoint has an invalid structure. — the specifically relevant limitation is: Postconditions evaluate values at the appropriate stage; a result that is unknown at plan may be checked later. It would therefore not resolve or assess the case as stated.
C:This is linked to a different situation: A deployment needs separate port numbers per environment and a documented default for developer sandboxes. There the relevant limitation is: Defaults should not embed production secrets or bypass review of production-specific values. For the question's actual requirement — A managed service should not continue to downstream provisioning if the returned endpoint has an invalid structure. — the specifically relevant limitation is: Postconditions evaluate values at the appropriate stage; a result that is unknown at plan may be checked later. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: An application secret is supplied as a Terraform variable marked sensitive, and a teammate claims it cannot enter a saved state file. There the relevant limitation is: sensitive primarily redacts normal CLI display; it does not by itself exclude a value from state. For the question's actual requirement — A managed service should not continue to downstream provisioning if the returned endpoint has an invalid structure. — the specifically relevant limitation is: Postconditions evaluate values at the appropriate stage; a result that is unknown at plan may be checked later. It would therefore not resolve or assess the case as stated.
Question 309
The team is reviewing a Terraform implementation for this case: A managed service should not continue to downstream provisioning if the returned endpoint has an invalid structure. Which tempting assumption would be specifically incorrect for this proposed implementation?
- Use terraform fmt as a substitute for runtime result invariants on managed objects.
- Treat a for expression as a command that modifies original remote resources in-place.
- Declare list(string) then index it by the environment name as if it were a map.
- Set ephemeral=true on a variable and then use it freely in any ordinary output persisted to state.
Explanation
Correct Answer
A:Reject the assumption: Use terraform fmt as a substitute for runtime result invariants on managed objects. Instead, define a resource postcondition that validates the resulting endpoint before dependent resources proceed. Resource postconditions assert properties of results after relevant operations. Acceptance evidence: A failing postcondition signals an error and prevents downstream dependent actions.
Incorrect Answers
B:This is linked to a different situation: A pipeline produces a list of service names with inconsistent letter casing and needs normalized DNS labels. There the relevant misconception is: Treat a for expression as a command that modifies original remote resources in-place. For the question's actual requirement — A managed service should not continue to downstream provisioning if the returned endpoint has an invalid structure. — the specifically relevant misconception is: Use terraform fmt as a substitute for runtime result invariants on managed objects. It would therefore not resolve or assess the case as stated.
C:This is linked to a different situation: A configuration needs a map from environment names to individually selected instance classes, with each value a string. There the relevant misconception is: Declare list(string) then index it by the environment name as if it were a map. For the question's actual requirement — A managed service should not continue to downstream provisioning if the returned endpoint has an invalid structure. — the specifically relevant misconception is: Use terraform fmt as a substitute for runtime result invariants on managed objects. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: A short-lived token must be used during an operation, and auditors require that the token not be written to a plan file. There the relevant misconception is: Set ephemeral=true on a variable and then use it freely in any ordinary output persisted to state. For the question's actual requirement — A managed service should not continue to downstream provisioning if the returned endpoint has an invalid structure. — the specifically relevant misconception is: Use terraform fmt as a substitute for runtime result invariants on managed objects. It would therefore not resolve or assess the case as stated.
Question 310
A Terraform platform team is coordinating 3 independent decisions. Workstream A: A managed service should not continue to downstream provisioning if the returned endpoint has an invalid structure. and Workstream B: An analyst needs to inspect one managed resource's recorded attributes and associated provider metadata during an incident. and Workstream C: A team considers keeping .terraform.lock.hcl in a secrets vault because it thinks the file is the primary infrastructure state store. Select exactly 3 actions, one addressing each distinct workstream.
- Use the cloud integration block for workspace mapping and authenticate with terraform login securely.
- Specify a reviewed registry-module version constraint in the module block.
- Define a resource postcondition that validates the resulting endpoint before dependent resources proceed.
- Declare aliases in the child required_providers and explicitly pass both in the parent module.providers mapping.
- Distinguish provider-version lock metadata from terraform.tfstate and protect the actual state through suitable backend controls.
- Use terraform state show ADDRESS or a carefully scoped terraform show output on the selected state.
Explanation
Correct Answers
C:For the workstream in which a managed service should not continue to downstream provisioning if the returned endpoint has an invalid structure, use this action: Define a resource postcondition that validates the resulting endpoint before dependent resources proceed. Resource postconditions assert properties of results after relevant operations. Verify: A failing postcondition signals an error and prevents downstream dependent actions. Limitation: Postconditions evaluate values at the appropriate stage; a result that is unknown at plan may be checked later.
E: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.
F: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.
Incorrect Answers
A:This action is appropriate instead for a different, unlisted requirement: A local Terraform root must be connected to a specific HCP Terraform workspace without storing an API token in version control. It would be checked by: CLI commands authenticate to the correct HCP organization/workspace and work with managed remote state. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.
B:This action is appropriate instead for a different, unlisted requirement: A team uses a module from the public registry and needs to prevent unreviewed minor changes after a security assessment. It would be checked by: Initialization selects a module release satisfying the stated registry version requirement. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.
D:This action is appropriate instead for a different, unlisted requirement: A child module must receive two non-default provider aliases for cross-region VPN creation. It would be checked by: The child's plan uses the two exact provider instances rather than silently defaulting to one region. 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