HashiCorp Terraform Associate 004 Exam Dumps, Practice Test Questions

100% Latest & Updated HashiCorp Terraform Associate 004 Practice Test Questions, Exam Dumps & Verified Answers!
30 Days Free Updates, Instant Download!

HashiCorp Terraform Associate 004 Premium Bundle
$64.98
$54.98

Terraform Associate 004 Premium Bundle

  • Premium File: 167 Questions & Answers. Last update: Nov 9, 2026
  • Study Guide: 285 Pages
  • Latest Questions
  • 100% Accurate Answers
  • Fast Exam Updates

Terraform Associate 004 Premium Bundle

HashiCorp Terraform Associate 004 Premium Bundle
  • Premium File: 167 Questions & Answers. Last update: Nov 9, 2026
  • Study Guide: 285 Pages
  • Latest Questions
  • 100% Accurate Answers
  • Fast Exam Updates
$64.98
$54.98

HashiCorp Terraform Associate 004 Practice Test 30

Question 290

A Terraform platform team is coordinating 3 independent decisions. Workstream A: A service cannot tolerate downtime when replacing a VM and the provider's planned operation requires destroy-and-create. and Workstream B: A database already exists outside Terraform but needs to become managed under an explicit new resource address. and Workstream C: A security team calls the same reusable child module twice, once under each of two cloud accounts. Select exactly 3 actions, one addressing each distinct workstream.

  1. Choose an explicit Git ref in the source URL rather than the registry-specific module version argument.
  2. Expect the default local backend to manage a terraform.tfstate file in the working directory.
  3. Run a refresh-only plan, review its state changes, and apply refresh-only if the update is appropriate.
  4. Consider lifecycle create_before_destroy on the managed resource after confirming simultaneous old and new instances are permitted.
  5. Pass a different root provider configuration into each module call through its providers map.
  6. Write a matching resource declaration and use an import block or terraform import with the real object identifier.

Explanation

Correct Answers

D:

For the workstream in which a service cannot tolerate downtime when replacing a VM and the provider's planned operation requires destroy-and-create, use this action: Consider lifecycle create_before_destroy on the managed resource after confirming simultaneous old and new instances are permitted. Lifecycle replacement ordering can reduce interruption but does not override provider or service constraints. Verify: The replacement plan creates the new instance before destroying the old one where provider constraints allow. Limitation: Unique names, fixed addresses, quotas, and dependent resources may prevent this pattern from succeeding.

E:

For the workstream in which a security team calls the same reusable child module twice, once under each of two cloud accounts, use this action: Pass a different root provider configuration into each module call through its providers map. Provider instances are configured at the root and passed to module instances as needed. Verify: Each module instance is associated with the correct account provider during plan. Limitation: Do not put shared provider configuration blocks inside a modern reusable child module to solve this mapping.

F:

For the workstream in which a database already exists outside Terraform but needs to become managed under an explicit new resource address, use this action: Write a matching resource declaration and use an import block or terraform import with the real object identifier. Import binds an existing remote object to a Terraform resource address. Verify: State gains the intended address and a reviewed plan evaluates remaining configuration differences. Limitation: Import establishes identity and may not generate all required configuration fields automatically.

Incorrect Answers

A:

This action is appropriate instead for a different, unlisted requirement: A private Git-sourced module has a reviewed release tag and an engineer adds version = "2.3" next to its Git source. It would be checked by: Terraform downloads the module code at the intended Git tag or commit during init. 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 developer uses a fresh local Terraform directory with no backend block and asks where state will be written after apply. It would be checked by: A successful local apply creates or updates a locally persisted state snapshot for the selected workspace. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.

C:

This action is appropriate instead for a different, unlisted requirement: A company intentionally altered remote settings and wants Terraform state to reflect the real objects without proposing configuration-driven remediation yet. It would be checked by: State and root outputs synchronize with observed remote data without changing the cloud object itself. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.

Question 291

An infrastructure team faces this specific situation: A team's database must never be accidentally destroyed by a routine Terraform plan while its resource declaration remains managed. Which Terraform action most directly satisfies the requirement?

  1. Expose the needed value through an output block in the child and reference module.child.output_name.
  2. Add a variable validation block with a clear condition and error message appropriate for the supported expression.
  3. Set lifecycle prevent_destroy and verify the protection is exercised by a proposed destructive plan.
  4. Reference the selected data source attribute in the managed resource's image argument.

Explanation

Correct Answer

C:

For this case, the appropriate action is: 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. Confirm it by checking: A plan that would destroy the configured protected resource is rejected with an error. Boundary: Removing the entire resource block also removes this configuration-based guard; it is not permanent cloud-side deletion protection.

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 team's database must never be accidentally destroyed by a routine Terraform plan while its resource declaration remains managed. — the specifically relevant decision is: Set lifecycle prevent_destroy and verify the protection is exercised by a proposed destructive plan. It would therefore not resolve or assess the case as stated.

B:

This is linked to a different situation: A reusable module needs to reject a user-provided CIDR that is outside a documented allowed address family. There the relevant decision is: Add a variable validation block with a clear condition and error message appropriate for the supported expression. For the question's actual requirement — A team's database must never be accidentally destroyed by a routine Terraform plan while its resource declaration remains managed. — the specifically relevant decision is: Set lifecycle prevent_destroy and verify the protection is exercised by a proposed destructive plan. 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 decision is: Reference the selected data source attribute in the managed resource's image argument. For the question's actual requirement — A team's database must never be accidentally destroyed by a routine Terraform plan while its resource declaration remains managed. — the specifically relevant decision is: Set lifecycle prevent_destroy and verify the protection is exercised by a proposed destructive plan. It would therefore not resolve or assess the case as stated.

Question 292

A reviewer is confirming a change for the following use case: A team's database must never be accidentally destroyed by a routine Terraform plan while its resource declaration remains managed. The implementation follows this approach: Set lifecycle prevent_destroy and verify the protection is exercised by a proposed destructive plan. Which observation or acceptance test most directly verifies the intended result?

  1. A plan that would destroy the configured protected resource is rejected with an error.
  2. The plan selects the production hostname only when the condition evaluates true.
  3. Version-controlled HCL contains no hardcoded cleartext credential and the approved secret path is resolvable at runtime.
  4. Repeated port values collapse to unique members without relying on list positions.

Explanation

Correct Answer

A:

Acceptance evidence: A plan that would destroy the configured protected resource is rejected with an error. It validates the proposed action, set lifecycle prevent_destroy and verify the protection is exercised by a proposed destructive plan, because prevent_destroy rejects destructive plans while its rule is present in managed configuration. Remaining limitation: Removing the entire resource block also removes this configuration-based guard; it is not permanent cloud-side deletion protection.

Incorrect Answers

B:

This is linked to a different situation: A deployment needs to choose a service hostname based on whether the environment is production. There the relevant acceptance is: The plan selects the production hostname only when the condition evaluates true. For the question's actual requirement — A team's database must never be accidentally destroyed by a routine Terraform plan while its resource declaration remains managed. — the specifically relevant acceptance is: A plan that would destroy the configured protected resource is rejected with an error. It would therefore not resolve or assess the case as stated.

C:

This is linked to a different situation: A company rotates application credentials in Vault and wants Terraform pipelines to avoid checking decrypted secrets into source control. There the relevant acceptance is: Version-controlled HCL contains no hardcoded cleartext credential and the approved secret path is resolvable at runtime. For the question's actual requirement — A team's database must never be accidentally destroyed by a routine Terraform plan while its resource declaration remains managed. — the specifically relevant acceptance is: A plan that would destroy the configured protected resource is rejected with an error. It would therefore not resolve or assess the case as stated.

D:

This is linked to a different situation: A security allowlist is an unordered set of unique ports and duplicate entries must not affect the configuration. There the relevant acceptance is: Repeated port values collapse to unique members without relying on list positions. For the question's actual requirement — A team's database must never be accidentally destroyed by a routine Terraform plan while its resource declaration remains managed. — the specifically relevant acceptance is: A plan that would destroy the configured protected resource is rejected with an error. It would therefore not resolve or assess the case as stated.

Question 293

Consider a proposed solution for this requirement: A team's database must never be accidentally destroyed by a routine Terraform plan while its resource declaration remains managed. The team plans to do the following: Set lifecycle prevent_destroy and verify the protection is exercised by a proposed destructive plan. Which limitation or operational caveat must remain in the review?

  1. Removing or renaming a key can still destroy or replace that keyed resource instance.
  2. Removing the entire resource block also removes this configuration-based guard; it is not permanent cloud-side deletion protection.
  3. Input variable declarations are module-scoped, not automatically shared across the entire configuration.
  4. dynamic can generate normal nested blocks, not arbitrary provider meta-arguments or resource blocks.

Explanation

Correct Answer

B:

The limitation is removing the entire resource block also removes this configuration-based guard; it is not permanent cloud-side deletion protection. The proposed change is set lifecycle prevent_destroy and verify the protection is exercised by a proposed destructive plan. Validate it by checking a plan that would destroy the configured protected resource is rejected with an error. prevent_destroy rejects destructive plans while its rule is present in managed configuration.

Incorrect Answers

A:

This is linked to a different situation: An application team must create one DNS record per hostname from a stable set of known domain names. There the relevant limitation is: Removing or renaming a key can still destroy or replace that keyed resource instance. For the question's actual requirement — A team's database must never be accidentally destroyed by a routine Terraform plan while its resource declaration remains managed. — the specifically relevant limitation is: Removing the entire resource block also removes this configuration-based guard; it is not permanent cloud-side deletion protection. It would therefore not resolve or assess the case as stated.

C:

This is linked to a different situation: A child module expects a variable named subnet_ids, but the calling root references an undeclared variable from inside the child. There the relevant limitation is: Input variable declarations are module-scoped, not automatically shared across the entire configuration. For the question's actual requirement — A team's database must never be accidentally destroyed by a routine Terraform plan while its resource declaration remains managed. — the specifically relevant limitation is: Removing the entire resource block also removes this configuration-based guard; it is not permanent cloud-side deletion protection. It would therefore not resolve or assess the case as stated.

D:

This is linked to a different situation: A security group requires multiple repeated ingress blocks derived from a variable collection, and copy-pasting blocks is error-prone. There the relevant limitation is: dynamic can generate normal nested blocks, not arbitrary provider meta-arguments or resource blocks. For the question's actual requirement — A team's database must never be accidentally destroyed by a routine Terraform plan while its resource declaration remains managed. — the specifically relevant limitation is: Removing the entire resource block also removes this configuration-based guard; it is not permanent cloud-side deletion protection. It would therefore not resolve or assess the case as stated.

Question 294

The team is reviewing a Terraform implementation for this case: A team's database must never be accidentally destroyed by a routine Terraform plan while its resource declaration remains managed. Which tempting assumption would be specifically incorrect for this proposed implementation?

  1. Rewrite the variable block's default on every run as the required deployment interface.
  2. Assume prevent_destroy continues to protect an object after the containing resource block is deleted.
  3. Treat sensitive=true as encryption and guaranteed exclusion of a secret from state.
  4. Use dynamic to create multiple top-level resource blocks directly inside one resource.

Explanation

Correct Answer

B:

Reject the assumption: Assume prevent_destroy continues to protect an object after the containing resource block is deleted. Instead, 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. Acceptance evidence: A plan that would destroy the configured protected resource is rejected with an error.

Incorrect Answers

A:

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 misconception is: Rewrite the variable block's default on every run as the required deployment interface. For the question's actual requirement — A team's database must never be accidentally destroyed by a routine Terraform plan while its resource declaration remains managed. — the specifically relevant misconception is: Assume prevent_destroy continues to protect an object after the containing resource block is deleted. It would therefore not resolve or assess the case as stated.

C:

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 misconception is: Treat sensitive=true as encryption and guaranteed exclusion of a secret from state. For the question's actual requirement — A team's database must never be accidentally destroyed by a routine Terraform plan while its resource declaration remains managed. — the specifically relevant misconception is: Assume prevent_destroy continues to protect an object after the containing resource block is deleted. It would therefore not resolve or assess the case as stated.

D:

This is linked to a different situation: A security group requires multiple repeated ingress blocks derived from a variable collection, and copy-pasting blocks is error-prone. There the relevant misconception is: Use dynamic to create multiple top-level resource blocks directly inside one resource. For the question's actual requirement — A team's database must never be accidentally destroyed by a routine Terraform plan while its resource declaration remains managed. — the specifically relevant misconception is: Assume prevent_destroy continues to protect an object after the containing resource block is deleted. It would therefore not resolve or assess the case as stated.

Question 295

A Terraform platform team is coordinating 2 independent decisions. Workstream A: A team's database must never be accidentally destroyed by a routine Terraform plan while its resource declaration remains managed. and Workstream B: An engineer is importing one cloud instance but attempts to assign the same remote object to two Terraform resource addresses. Select exactly 2 actions, one addressing each distinct workstream.

  1. Keep one authoritative managed address per remote object and refactor references accordingly.
  2. Review the HCL change through version control and inspect a Terraform execution plan before authorized apply.
  3. Set lifecycle prevent_destroy and verify the protection is exercised by a proposed destructive plan.
  4. Select suitable Azure and monitoring providers and declare both systems through one Terraform root module.
  5. Import the existing bucket into an appropriate resource address after writing matching configuration.

Explanation

Correct Answers

A:

For the workstream in which an engineer is importing one cloud instance but attempts to assign the same remote object to two Terraform resource addresses, use this action: Keep one authoritative managed address per remote object and refactor references accordingly. Terraform expects a managed remote object to have a consistent single ownership binding. Verify: State inspection shows the imported instance at a single intended address. Limitation: Multiple bindings to the same real object can produce unpredictable lifecycle behavior.

C:

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.

Incorrect Answers

B:

This option addresses a separate requirement: An operations group wants four engineers to propose a subnet change without all four immediately modifying production. Evidence for that other requirement would be a pull request includes configuration differences and a plan describing expected resource mutations; neither listed workstream asks for it.

D:

This option addresses a separate requirement: A company uses Azure for application workloads and a SaaS provider for monitoring, and wants to avoid managing two separate IaC languages. Evidence for that other requirement would be plan output contains the cloud deployment and monitoring integrations with clear provider ownership; neither listed workstream asks for it.

E:

This option addresses a separate requirement: A storage bucket exists in the cloud, but Terraform proposes creating another bucket with the intended name because its state has no binding. Evidence for that other requirement would be the state lists the imported address, and a subsequent plan can be evaluated for unintended differences; neither listed workstream asks for it.

Question 296

An infrastructure team faces this specific situation: A managed resource's tag is updated by an external compliance agent, and Terraform must not revert only that tag on every plan. Which Terraform action most directly satisfies the requirement?

  1. Use lifecycle ignore_changes for the specifically shared tag attribute after agreeing which system owns it.
  2. Declare a managed resource for the new load balancer and an appropriate data source for the existing network lookup.
  3. Declare map(string) as the input type and select an entry by key, such as var.instance_class["staging"].
  4. Reference the security group resource attribute directly from the database argument.

Explanation

Correct Answer

A:

For this case, the appropriate action is: 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. Confirm it by checking: Subsequent plans avoid proposing updates solely because the ignored tag changed outside Terraform. Boundary: Ignore rules do not ignore the attribute at initial resource creation and can hide meaningful drift if used too broadly.

Incorrect Answers

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 decision is: Declare a managed resource for the new load balancer and an appropriate data source for the existing network lookup. For the question's actual requirement — A managed resource's tag is updated by an external compliance agent, and Terraform must not revert only that tag on every plan. — the specifically relevant decision is: Use lifecycle ignore_changes for the specifically shared tag attribute after agreeing which system owns it. 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 decision is: Declare map(string) as the input type and select an entry by key, such as var.instance_class["staging"]. For the question's actual requirement — A managed resource's tag is updated by an external compliance agent, and Terraform must not revert only that tag on every plan. — the specifically relevant decision is: Use lifecycle ignore_changes for the specifically shared tag attribute after agreeing which system owns it. It would therefore not resolve or assess the case as stated.

D:

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 resource's tag is updated by an external compliance agent, and Terraform must not revert only that tag on every plan. — the specifically relevant decision is: Use lifecycle ignore_changes for the specifically shared tag attribute after agreeing which system owns it. It would therefore not resolve or assess the case as stated.

Question 297

A reviewer is confirming a change for the following use case: A managed resource's tag is updated by an external compliance agent, and Terraform must not revert only that tag on every plan. The implementation follows this approach: Use lifecycle ignore_changes for the specifically shared tag attribute after agreeing which system owns it. Which observation or acceptance test most directly verifies the intended result?

  1. Inspect the chosen mechanism and verify secrets do not appear in plan/state artifacts where omission is required.
  2. Subsequent plans avoid proposing updates solely because the ignored tag changed outside Terraform.
  3. The first, second, and third output elements correspond to documented ordered subnet assignments.
  4. Version-controlled HCL contains no hardcoded cleartext credential and the approved secret path is resolvable at runtime.

Explanation

Correct Answer

B:

Acceptance evidence: Subsequent plans avoid proposing updates solely because the ignored tag changed outside Terraform. It validates the proposed action, use lifecycle ignore_changes for the specifically shared tag attribute after agreeing which system owns it, because ignore_changes narrows drift reconciliation for selected attributes during updates. Remaining limitation: Ignore rules do not ignore the attribute at initial resource creation and can hide meaningful drift if used too broadly.

Incorrect Answers

A:

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 acceptance is: Inspect the chosen mechanism and verify secrets do not appear in plan/state artifacts where omission is required. For the question's actual requirement — A managed resource's tag is updated by an external compliance agent, and Terraform must not revert only that tag on every plan. — the specifically relevant acceptance is: Subsequent plans avoid proposing updates solely because the ignored tag changed outside Terraform. It would therefore not resolve or assess the case as stated.

C:

This is linked to a different situation: A module emits an ordered list of three subnet IDs aligned with ordered availability zones and consumers depend on position. There the relevant acceptance is: The first, second, and third output elements correspond to documented ordered subnet assignments. For the question's actual requirement — A managed resource's tag is updated by an external compliance agent, and Terraform must not revert only that tag on every plan. — the specifically relevant acceptance is: Subsequent plans avoid proposing updates solely because the ignored tag changed outside Terraform. It would therefore not resolve or assess the case as stated.

D:

This is linked to a different situation: A company rotates application credentials in Vault and wants Terraform pipelines to avoid checking decrypted secrets into source control. There the relevant acceptance is: Version-controlled HCL contains no hardcoded cleartext credential and the approved secret path is resolvable at runtime. For the question's actual requirement — A managed resource's tag is updated by an external compliance agent, and Terraform must not revert only that tag on every plan. — the specifically relevant acceptance is: Subsequent plans avoid proposing updates solely because the ignored tag changed outside Terraform. It would therefore not resolve or assess the case as stated.

Question 298

Consider a proposed solution for this requirement: A managed resource's tag is updated by an external compliance agent, and Terraform must not revert only that tag on every plan. The team plans to do the following: Use lifecycle ignore_changes for the specifically shared tag attribute after agreeing which system owns it. Which limitation or operational caveat must remain in the review?

  1. Checks and preconditions have different failure effects, so choose based on governance needs.
  2. A module output is an interface; it does not automatically expose every internal resource or local.
  3. Both branches need compatible types and the condition must be a boolean expression.
  4. Ignore rules do not ignore the attribute at initial resource creation and can hide meaningful drift if used too broadly.

Explanation

Correct Answer

D:

The limitation is ignore rules do not ignore the attribute at initial resource creation and can hide meaningful drift if used too broadly. The proposed change is use lifecycle ignore_changes for the specifically shared tag attribute after agreeing which system owns it. Validate it by checking subsequent plans avoid proposing updates solely because the ignored tag changed outside Terraform. ignore_changes narrows drift reconciliation for selected attributes during updates.

Incorrect Answers

A:

This is linked to a different situation: An operations group wants an infrastructure health assertion that can report a diagnostic without behaving exactly like a resource precondition. There the relevant limitation is: Checks and preconditions have different failure effects, so choose based on governance needs. For the question's actual requirement — A managed resource's tag is updated by an external compliance agent, and Terraform must not revert only that tag on every plan. — the specifically relevant limitation is: Ignore rules do not ignore the attribute at initial resource creation and can hide meaningful drift if used too broadly. It would therefore not resolve or assess the case as stated.

B:

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 limitation is: A module output is an interface; it does not automatically expose every internal resource or local. For the question's actual requirement — A managed resource's tag is updated by an external compliance agent, and Terraform must not revert only that tag on every plan. — the specifically relevant limitation is: Ignore rules do not ignore the attribute at initial resource creation and can hide meaningful drift if used too broadly. It would therefore not resolve or assess the case as stated.

C:

This is linked to a different situation: A deployment needs to choose a service hostname based on whether the environment is production. There the relevant limitation is: Both branches need compatible types and the condition must be a boolean expression. For the question's actual requirement — A managed resource's tag is updated by an external compliance agent, and Terraform must not revert only that tag on every plan. — the specifically relevant limitation is: Ignore rules do not ignore the attribute at initial resource creation and can hide meaningful drift if used too broadly. It would therefore not resolve or assess the case as stated.

Question 299

The team is reviewing a Terraform implementation for this case: A managed resource's tag is updated by an external compliance agent, and Terraform must not revert only that tag on every plan. Which tempting assumption would be specifically incorrect for this proposed implementation?

  1. Use a list and assume duplicate elements are automatically removed while maintaining indices.
  2. Disable state refresh entirely as the permanent way to share control of a single attribute.
  3. Expect the type string alone to reject a semantically invalid CIDR string.
  4. Treat an unrelated output value as though it automatically becomes a resource precondition.

Explanation

Correct Answer

B:

Reject the assumption: Disable state refresh entirely as the permanent way to share control of a single attribute. Instead, 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. Acceptance evidence: Subsequent plans avoid proposing updates solely because the ignored tag changed outside Terraform.

Incorrect Answers

A:

This is linked to a different situation: A security allowlist is an unordered set of unique ports and duplicate entries must not affect the configuration. There the relevant misconception is: Use a list and assume duplicate elements are automatically removed while maintaining indices. For the question's actual requirement — A managed resource's tag is updated by an external compliance agent, and Terraform must not revert only that tag on every plan. — the specifically relevant misconception is: Disable state refresh entirely as the permanent way to share control of a single attribute. It would therefore not resolve or assess the case as stated.

C:

This is linked to a different situation: A reusable module needs to reject a user-provided CIDR that is outside a documented allowed address family. There the relevant misconception is: Expect the type string alone to reject a semantically invalid CIDR string. For the question's actual requirement — A managed resource's tag is updated by an external compliance agent, and Terraform must not revert only that tag on every plan. — the specifically relevant misconception is: Disable state refresh entirely as the permanent way to share control of a single attribute. It would therefore not resolve or assess the case as stated.

D:

This is linked to a different situation: A team must verify a network policy's expected input range before taking an action that would violate the rule. There the relevant misconception is: Treat an unrelated output value as though it automatically becomes a resource precondition. For the question's actual requirement — A managed resource's tag is updated by an external compliance agent, and Terraform must not revert only that tag on every plan. — the specifically relevant misconception is: Disable state refresh entirely as the permanent way to share control of a single attribute. It would therefore not resolve or assess the case as stated.

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.

  1. Use lifecycle ignore_changes for the specifically shared tag attribute after agreeing which system owns it.
  2. Move to an appropriate shared backend with concurrency controls so both plans use the same authoritative state.
  3. Save the reviewed plan with terraform plan -out=release.tfplan and apply that saved plan file.
  4. Generate and review a plan for the import block, optionally using supported configuration generation where appropriate.
  5. Configure separate HCP workspaces with correct working directories and path-based VCS run triggers.
  6. 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.

HashiCorp Certified: Terraform Associate (004) (Terraform Associate 004) Practice Tests

UP

SPECIAL OFFER: GET 10% OFF

This is ONE TIME OFFER

ExamSnap Discount Offer
Enter Your Email Address to Receive Your 10% Off Discount Code

A confirmation link will be sent to this email address to verify your login. *We value your privacy. We will not rent or sell your email address.

Download Free Demo of VCE Exam Simulator

Experience Avanset VCE Exam Simulator for yourself.

Simply submit your e-mail address below to get started with our interactive software demo of your free trial.

Free Demo Limits: In the demo version you will be able to access only first 5 questions from exam.