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 46

Question 450

A Terraform platform team is coordinating 3 independent decisions. Workstream A: A security review finds AWS access keys passed in -backend-config and wants to reduce secret persistence in initialization files. and Workstream B: A service module declares use of a third-party provider but two different namespaces publish plugins with the same local name. and Workstream C: A deployment job must supply different nonsecret inputs for each pipeline run without editing source-controlled HCL. Select exactly 3 actions, one addressing each distinct workstream.

  1. Use supported environment-based backend credentials or identity rather than embedding credentials in backend configuration.
  2. Inspect terraform plan -replace=ADDRESS and review any downstream dependencies before applying.
  3. Use terraform state show ADDRESS or a carefully scoped terraform show output on the selected state.
  4. Specify the provider's full registry source address under terraform.required_providers.
  5. Pass values through appropriate .tfvars files or documented TF_VAR_name environment variables.
  6. Configure the workspace's VCS connection, working directory, and run triggers for the intended branch.

Explanation

Correct Answers

A:

For the workstream in which a security review finds AWS access keys passed in -backend-config and wants to reduce secret persistence in initialization files, use this action: Use supported environment-based backend credentials or identity rather than embedding credentials in backend configuration. State backends need their own secure authentication channel; configuration literals are not automatically secret-safe. Verify: Backend initialization succeeds without static access keys embedded in .terraform or saved plan artifacts. Limitation: Backend configuration data can be captured in local initialization metadata and plan files.

D:

For the workstream in which a service module declares use of a third-party provider but two different namespaces publish plugins with the same local name, use this action: Specify the provider's full registry source address under terraform.required_providers. Source addresses disambiguate providers that share local names. Verify: The lock entry identifies the intended registry namespace, provider type, and selected version. Limitation: Provider local names in HCL do not by themselves prove the external publisher namespace.

E:

For the workstream in which a deployment job must supply different nonsecret inputs for each pipeline run without editing source-controlled HCL, use this action: Pass values through appropriate .tfvars files or documented TF_VAR_name environment variables. Terraform evaluates input values separately from the module's reusable declarations. Verify: The plan uses the expected values while the shared module source remains unchanged. Limitation: Precedence between inputs must be understood and secret values still need secure sourcing.

Incorrect Answers

B:

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.

C:

This action is appropriate instead for a different, unlisted requirement: An analyst needs to inspect one managed resource's recorded attributes and associated provider metadata during an incident. It would be checked by: The selected resource's stored attributes and address are visible for diagnosis. 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 development team connects one infrastructure repository to an HCP Terraform workspace and expects reviewed commits to trigger plans. It would be checked by: A relevant commit produces a workspace run and pull requests can show speculative plans if configured. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.

Question 451

An infrastructure team faces this specific situation: A Terraform configuration contains both a cloud block and a backend block while planning to use HCP Terraform remote execution. Which Terraform action most directly satisfies the requirement?

  1. Select the appropriate HCP Terraform cloud integration and remove the conflicting backend declaration.
  2. Check the exact backend's current locking configuration and version-specific requirements before assuming locks work.
  3. Confirm there is no current state writer, then use force-unlock only for the team's own stale lock ID.
  4. Use a reviewed removed block with destroy = false or a careful terraform state rm operation to forget its binding.

Explanation

Correct Answer

A:

Select the appropriate HCP Terraform cloud integration and remove the conflicting backend declaration. HCP Terraform cloud integration and an explicit backend block are mutually exclusive in one root configuration. Verify: Initialization uses the configured HCP organization and workspace association without a second backend block. Limitation: Migrating existing state to cloud-managed workspaces needs a controlled review and backup.

Incorrect Answers

B:

This is linked to a different situation: An engineer asks whether selecting an S3 bucket as remote storage automatically guarantees supported state locking under every Terraform/backend version. There the relevant decision is: Check the exact backend's current locking configuration and version-specific requirements before assuming locks work. For the question's actual requirement — A Terraform configuration contains both a cloud block and a backend block while planning to use HCP Terraform remote execution. — the specifically relevant decision is: Select the appropriate HCP Terraform cloud integration and remove the conflicting backend declaration. It would therefore not resolve or assess the case as stated.

C:

This is linked to a different situation: A Terraform job crashed and left a stale lock, but the team has not verified whether any other run is active. There the relevant decision is: Confirm there is no current state writer, then use force-unlock only for the team's own stale lock ID. For the question's actual requirement — A Terraform configuration contains both a cloud block and a backend block while planning to use HCP Terraform remote execution. — the specifically relevant decision is: Select the appropriate HCP Terraform cloud integration and remove the conflicting backend declaration. It would therefore not resolve or assess the case as stated.

D:

This is linked to a different situation: A managed object should stop being controlled by Terraform while remaining physically available. There the relevant decision is: Use a reviewed removed block with destroy = false or a careful terraform state rm operation to forget its binding. For the question's actual requirement — A Terraform configuration contains both a cloud block and a backend block while planning to use HCP Terraform remote execution. — the specifically relevant decision is: Select the appropriate HCP Terraform cloud integration and remove the conflicting backend declaration. It would therefore not resolve or assess the case as stated.

Question 452

A reviewer is confirming a change for the following use case: A Terraform configuration contains both a cloud block and a backend block while planning to use HCP Terraform remote execution. The implementation follows this approach: Select the appropriate HCP Terraform cloud integration and remove the conflicting backend declaration. Which observation or acceptance test most directly verifies the intended result?

  1. The repository contains reviewed configuration and .terraform.lock.hcl, not transient cache or backend secrets.
  2. The reviewed plan explains which observed remote attributes differ from desired HCL.
  3. State and root outputs synchronize with observed remote data without changing the cloud object itself.
  4. Initialization uses the configured HCP organization and workspace association without a second backend block.

Explanation

Correct Answer

D:

Acceptance evidence: Initialization uses the configured HCP organization and workspace association without a second backend block. It validates the proposed action, select the appropriate HCP Terraform cloud integration and remove the conflicting backend declaration, because hCP Terraform cloud integration and an explicit backend block are mutually exclusive in one root configuration. Remaining limitation: Migrating existing state to cloud-managed workspaces needs a controlled review and backup.

Incorrect Answers

A:

This is linked to a different situation: An engineer wants to commit the local .terraform directory to source control because it contains provider caches and backend settings. There the relevant acceptance is: The repository contains reviewed configuration and .terraform.lock.hcl, not transient cache or backend secrets. For the question's actual requirement — A Terraform configuration contains both a cloud block and a backend block while planning to use HCP Terraform remote execution. — the specifically relevant acceptance is: Initialization uses the configured HCP organization and workspace association without a second backend block. It would therefore not resolve or assess the case as stated.

B:

This is linked to a different situation: An operations team edits cloud VM tags manually, and normal Terraform plan shows an unexpected change even though HCL has not changed. There the relevant acceptance is: The reviewed plan explains which observed remote attributes differ from desired HCL. For the question's actual requirement — A Terraform configuration contains both a cloud block and a backend block while planning to use HCP Terraform remote execution. — the specifically relevant acceptance is: Initialization uses the configured HCP organization and workspace association without a second backend block. It would therefore not resolve or assess the case as stated.

C:

This is linked to a different situation: A company intentionally altered remote settings and wants Terraform state to reflect the real objects without proposing configuration-driven remediation yet. There the relevant acceptance is: State and root outputs synchronize with observed remote data without changing the cloud object itself. For the question's actual requirement — A Terraform configuration contains both a cloud block and a backend block while planning to use HCP Terraform remote execution. — the specifically relevant acceptance is: Initialization uses the configured HCP organization and workspace association without a second backend block. It would therefore not resolve or assess the case as stated.

Question 453

Consider a proposed solution for this requirement: A Terraform configuration contains both a cloud block and a backend block while planning to use HCP Terraform remote execution. The team plans to do the following: Select the appropriate HCP Terraform cloud integration and remove the conflicting backend declaration. Which limitation or operational caveat must remain in the review?

  1. Migrating existing state to cloud-managed workspaces needs a controlled review and backup.
  2. Moved blocks need correct old/new addresses and should be reviewed for concurrent changes.
  3. Storage location alone does not prove the required locking mechanism is configured or supported.
  4. A repo may use a remote backend, but local initialization data can still expose backend credentials.

Explanation

Correct Answer

A:

The limitation is migrating existing state to cloud-managed workspaces needs a controlled review and backup. The proposed change is select the appropriate HCP Terraform cloud integration and remove the conflicting backend declaration. Validate it by checking initialization uses the configured HCP organization and workspace association without a second backend block. HCP Terraform cloud integration and an explicit backend block are mutually exclusive in one root configuration.

Incorrect Answers

B:

This is linked to a different situation: A resource was renamed from aws_instance.app to aws_instance.frontend in HCL, but it is the same underlying VM. There the relevant limitation is: Moved blocks need correct old/new addresses and should be reviewed for concurrent changes. For the question's actual requirement — A Terraform configuration contains both a cloud block and a backend block while planning to use HCP Terraform remote execution. — the specifically relevant limitation is: Migrating existing state to cloud-managed workspaces needs a controlled review and backup. It would therefore not resolve or assess the case as stated.

C:

This is linked to a different situation: An engineer asks whether selecting an S3 bucket as remote storage automatically guarantees supported state locking under every Terraform/backend version. There the relevant limitation is: Storage location alone does not prove the required locking mechanism is configured or supported. For the question's actual requirement — A Terraform configuration contains both a cloud block and a backend block while planning to use HCP Terraform remote execution. — the specifically relevant limitation is: Migrating existing state to cloud-managed workspaces needs a controlled review and backup. It would therefore not resolve or assess the case as stated.

D:

This is linked to a different situation: An engineer wants to commit the local .terraform directory to source control because it contains provider caches and backend settings. There the relevant limitation is: A repo may use a remote backend, but local initialization data can still expose backend credentials. For the question's actual requirement — A Terraform configuration contains both a cloud block and a backend block while planning to use HCP Terraform remote execution. — the specifically relevant limitation is: Migrating existing state to cloud-managed workspaces needs a controlled review and backup. It would therefore not resolve or assess the case as stated.

Question 454

The team is reviewing a Terraform implementation for this case: A Terraform configuration contains both a cloud block and a backend block while planning to use HCP Terraform remote execution. Which tempting assumption would be specifically incorrect for this proposed implementation?

  1. Assume the word remote guarantees every backend acquires a lock for every state write.
  2. Commit .terraform/ to guarantee reproducibility and treat the directory as harmless source code.
  3. Assume unchanged Terraform files imply remote infrastructure cannot drift.
  4. Keep simultaneous cloud and backend blocks and expect Terraform to merge their state locations.

Explanation

Correct Answer

D:

Reject the assumption: Keep simultaneous cloud and backend blocks and expect Terraform to merge their state locations. Instead, select the appropriate HCP Terraform cloud integration and remove the conflicting backend declaration. HCP Terraform cloud integration and an explicit backend block are mutually exclusive in one root configuration. Acceptance evidence: Initialization uses the configured HCP organization and workspace association without a second backend block.

Incorrect Answers

A:

This is linked to a different situation: An engineer asks whether selecting an S3 bucket as remote storage automatically guarantees supported state locking under every Terraform/backend version. There the relevant misconception is: Assume the word remote guarantees every backend acquires a lock for every state write. For the question's actual requirement — A Terraform configuration contains both a cloud block and a backend block while planning to use HCP Terraform remote execution. — the specifically relevant misconception is: Keep simultaneous cloud and backend blocks and expect Terraform to merge their state locations. It would therefore not resolve or assess the case as stated.

B:

This is linked to a different situation: An engineer wants to commit the local .terraform directory to source control because it contains provider caches and backend settings. There the relevant misconception is: Commit .terraform/ to guarantee reproducibility and treat the directory as harmless source code. For the question's actual requirement — A Terraform configuration contains both a cloud block and a backend block while planning to use HCP Terraform remote execution. — the specifically relevant misconception is: Keep simultaneous cloud and backend blocks and expect Terraform to merge their state locations. It would therefore not resolve or assess the case as stated.

C:

This is linked to a different situation: An operations team edits cloud VM tags manually, and normal Terraform plan shows an unexpected change even though HCL has not changed. There the relevant misconception is: Assume unchanged Terraform files imply remote infrastructure cannot drift. For the question's actual requirement — A Terraform configuration contains both a cloud block and a backend block while planning to use HCP Terraform remote execution. — the specifically relevant misconception is: Keep simultaneous cloud and backend blocks and expect Terraform to merge their state locations. It would therefore not resolve or assess the case as stated.

Question 455

A Terraform platform team is coordinating 2 independent decisions. Workstream A: A Terraform configuration contains both a cloud block and a backend block while planning to use HCP Terraform remote execution. and Workstream B: An engineer thinks the provider block installs the AWS provider and a resource block selects the AWS account by itself. Select exactly 2 actions, one addressing each distinct workstream.

  1. Select the appropriate HCP Terraform cloud integration and remove the conflicting backend declaration.
  2. Reuse one reviewed Terraform module with explicit environment inputs instead of independently editing each deployment.
  3. Declare installation metadata in required_providers and put operational region or endpoint settings in provider configuration.
  4. Publish and consume approved modules through an HCP Terraform private module registry with reviewed versions.
  5. Declare map(string) as the input type and select an entry by key, such as var.instance_class["staging"].

Explanation

Correct Answers

A:

For the workstream in which a Terraform configuration contains both a cloud block and a backend block while planning to use HCP Terraform remote execution, use this action: Select the appropriate HCP Terraform cloud integration and remove the conflicting backend declaration. HCP Terraform cloud integration and an explicit backend block are mutually exclusive in one root configuration. Verify: Initialization uses the configured HCP organization and workspace association without a second backend block. Limitation: Migrating existing state to cloud-managed workspaces needs a controlled review and backup.

C:

For the workstream in which an engineer thinks the provider block installs the AWS provider and a resource block selects the AWS account by itself, use this action: Declare installation metadata in required_providers and put operational region or endpoint settings in provider configuration. Provider requirements and provider configuration have separate responsibilities. Verify: Init obtains the required plugin; plan uses the configured provider instance for API calls. Limitation: Provider settings do not guarantee permission to create any resource without valid credentials and IAM rights.

Incorrect Answers

B:

This option addresses a separate requirement: Two branches of a retailer deploy similar staging clusters, but each hand-built cluster gradually acquires different firewall rules. Evidence for that other requirement would be review version-control diffs and compare planned firewall changes for both environments; neither listed workstream asks for it.

D:

This option addresses a separate requirement: An organization wants approved modules discoverable by many teams without copying source trees into every repo. Evidence for that other requirement would be authorized workspaces resolve the approved private registry module during initialization; neither listed workstream asks for it.

E:

This option addresses a separate requirement: A configuration needs a map from environment names to individually selected instance classes, with each value a string. Evidence for that other requirement would be the selected environment returns the class value under the requested map key; neither listed workstream asks for it.

Question 456

An infrastructure team faces this specific situation: A migration changes a backend location but the team must preserve all existing state bindings. Which Terraform action most directly satisfies the requirement?

  1. Configure an appropriate supported remote backend with secure access and locking rather than emailing terraform.tfstate.
  2. Let the state lock serialize operations and retry after the active writer finishes.
  3. Interpret the refreshed plan as detected drift and decide whether to restore declared tags or intentionally update configuration.
  4. Back up the current state and use terraform init -migrate-state when moving to the newly configured backend.

Explanation

Correct Answer

D:

Back up the current state and use terraform init -migrate-state when moving to the newly configured backend. Backend migration must transfer the existing state, not simply change where Terraform searches for it. Verify: The destination backend reflects the prior managed resource addresses and lineage after migration. Limitation: Misconfigured credentials or failed migration should block an apply rather than trigger new resource creation.

Incorrect Answers

A:

This is linked to a different situation: A team's state file is stored on a laptop and must be shared across several engineers without copying it manually after every change. There the relevant decision is: Configure an appropriate supported remote backend with secure access and locking rather than emailing terraform.tfstate. For the question's actual requirement — A migration changes a backend location but the team must preserve all existing state bindings. — the specifically relevant decision is: Back up the current state and use terraform init -migrate-state when moving to the newly configured backend. It would therefore not resolve or assess the case as stated.

B:

This is linked to a different situation: Two release pipelines try to update the same remote state simultaneously and one sees a lock-acquisition failure. There the relevant decision is: Let the state lock serialize operations and retry after the active writer finishes. For the question's actual requirement — A migration changes a backend location but the team must preserve all existing state bindings. — the specifically relevant decision is: Back up the current state and use terraform init -migrate-state when moving to the newly configured backend. It would therefore not resolve or assess the case as stated.

C:

This is linked to a different situation: An operations team edits cloud VM tags manually, and normal Terraform plan shows an unexpected change even though HCL has not changed. There the relevant decision is: Interpret the refreshed plan as detected drift and decide whether to restore declared tags or intentionally update configuration. For the question's actual requirement — A migration changes a backend location but the team must preserve all existing state bindings. — the specifically relevant decision is: Back up the current state and use terraform init -migrate-state when moving to the newly configured backend. It would therefore not resolve or assess the case as stated.

Question 457

A reviewer is confirming a change for the following use case: A migration changes a backend location but the team must preserve all existing state bindings. The implementation follows this approach: Back up the current state and use terraform init -migrate-state when moving to the newly configured backend. Which observation or acceptance test most directly verifies the intended result?

  1. The repository contains reviewed configuration and .terraform.lock.hcl, not transient cache or backend secrets.
  2. Only one run modifies the protected state at a time and the second safely waits or fails.
  3. A controlled test or backend documentation confirms a lock is obtained for state-mutating operations.
  4. The destination backend reflects the prior managed resource addresses and lineage after migration.

Explanation

Correct Answer

D:

Acceptance evidence: The destination backend reflects the prior managed resource addresses and lineage after migration. It validates the proposed action, back up the current state and use terraform init -migrate-state when moving to the newly configured backend, because backend migration must transfer the existing state, not simply change where Terraform searches for it. Remaining limitation: Misconfigured credentials or failed migration should block an apply rather than trigger new resource creation.

Incorrect Answers

A:

This is linked to a different situation: An engineer wants to commit the local .terraform directory to source control because it contains provider caches and backend settings. There the relevant acceptance is: The repository contains reviewed configuration and .terraform.lock.hcl, not transient cache or backend secrets. For the question's actual requirement — A migration changes a backend location but the team must preserve all existing state bindings. — the specifically relevant acceptance is: The destination backend reflects the prior managed resource addresses and lineage after migration. It would therefore not resolve or assess the case as stated.

B:

This is linked to a different situation: Two release pipelines try to update the same remote state simultaneously and one sees a lock-acquisition failure. There the relevant acceptance is: Only one run modifies the protected state at a time and the second safely waits or fails. For the question's actual requirement — A migration changes a backend location but the team must preserve all existing state bindings. — the specifically relevant acceptance is: The destination backend reflects the prior managed resource addresses and lineage after migration. It would therefore not resolve or assess the case as stated.

C:

This is linked to a different situation: An engineer asks whether selecting an S3 bucket as remote storage automatically guarantees supported state locking under every Terraform/backend version. There the relevant acceptance is: A controlled test or backend documentation confirms a lock is obtained for state-mutating operations. For the question's actual requirement — A migration changes a backend location but the team must preserve all existing state bindings. — the specifically relevant acceptance is: The destination backend reflects the prior managed resource addresses and lineage after migration. It would therefore not resolve or assess the case as stated.

Question 458

Consider a proposed solution for this requirement: A migration changes a backend location but the team must preserve all existing state bindings. The team plans to do the following: Back up the current state and use terraform init -migrate-state when moving to the newly configured backend. Which limitation or operational caveat must remain in the review?

  1. If configuration still declares the object, a normal later plan may attempt to create it again.
  2. Storage location alone does not prove the required locking mechanism is configured or supported.
  3. Misconfigured credentials or failed migration should block an apply rather than trigger new resource creation.
  4. Remote storage is only as safe as its access policy, encryption, versioning, and locking support.

Explanation

Correct Answer

C:

The limitation is misconfigured credentials or failed migration should block an apply rather than trigger new resource creation. The proposed change is back up the current state and use terraform init -migrate-state when moving to the newly configured backend. Validate it by checking the destination backend reflects the prior managed resource addresses and lineage after migration. Backend migration must transfer the existing state, not simply change where Terraform searches for it.

Incorrect Answers

A:

This is linked to a different situation: A managed object should stop being controlled by Terraform while remaining physically available. There the relevant limitation is: If configuration still declares the object, a normal later plan may attempt to create it again. For the question's actual requirement — A migration changes a backend location but the team must preserve all existing state bindings. — the specifically relevant limitation is: Misconfigured credentials or failed migration should block an apply rather than trigger new resource creation. It would therefore not resolve or assess the case as stated.

B:

This is linked to a different situation: An engineer asks whether selecting an S3 bucket as remote storage automatically guarantees supported state locking under every Terraform/backend version. There the relevant limitation is: Storage location alone does not prove the required locking mechanism is configured or supported. For the question's actual requirement — A migration changes a backend location but the team must preserve all existing state bindings. — the specifically relevant limitation is: Misconfigured credentials or failed migration should block an apply rather than trigger new resource creation. It would therefore not resolve or assess the case as stated.

D:

This is linked to a different situation: A team's state file is stored on a laptop and must be shared across several engineers without copying it manually after every change. There the relevant limitation is: Remote storage is only as safe as its access policy, encryption, versioning, and locking support. For the question's actual requirement — A migration changes a backend location but the team must preserve all existing state bindings. — the specifically relevant limitation is: Misconfigured credentials or failed migration should block an apply rather than trigger new resource creation. It would therefore not resolve or assess the case as stated.

Question 459

The team is reviewing a Terraform implementation for this case: A migration changes a backend location but the team must preserve all existing state bindings. Which tempting assumption would be specifically incorrect for this proposed implementation?

  1. Use terraform init -reconfigure as if it always copies state to a new backend.
  2. Assume all Terraform operations automatically use HCP Terraform remote state without configuring it.
  3. Assume unchanged Terraform files imply remote infrastructure cannot drift.
  4. Delete the prior resource block and assume Terraform automatically knows a new resource name is equivalent.

Explanation

Correct Answer

A:

Reject the assumption: Use terraform init -reconfigure as if it always copies state to a new backend. Instead, back up the current state and use terraform init -migrate-state when moving to the newly configured backend. Backend migration must transfer the existing state, not simply change where Terraform searches for it. Acceptance evidence: The destination backend reflects the prior managed resource addresses and lineage after migration.

Incorrect Answers

B:

This is linked to a different situation: A developer uses a fresh local Terraform directory with no backend block and asks where state will be written after apply. There the relevant misconception is: Assume all Terraform operations automatically use HCP Terraform remote state without configuring it. For the question's actual requirement — A migration changes a backend location but the team must preserve all existing state bindings. — the specifically relevant misconception is: Use terraform init -reconfigure as if it always copies state to a new backend. It would therefore not resolve or assess the case as stated.

C:

This is linked to a different situation: An operations team edits cloud VM tags manually, and normal Terraform plan shows an unexpected change even though HCL has not changed. There the relevant misconception is: Assume unchanged Terraform files imply remote infrastructure cannot drift. For the question's actual requirement — A migration changes a backend location but the team must preserve all existing state bindings. — the specifically relevant misconception is: Use terraform init -reconfigure as if it always copies state to a new backend. It would therefore not resolve or assess the case as stated.

D:

This is linked to a different situation: A resource was renamed from aws_instance.app to aws_instance.frontend in HCL, but it is the same underlying VM. There the relevant misconception is: Delete the prior resource block and assume Terraform automatically knows a new resource name is equivalent. For the question's actual requirement — A migration changes a backend location but the team must preserve all existing state bindings. — the specifically relevant misconception is: Use terraform init -reconfigure as if it always copies state to a new backend. It would therefore not resolve or assess the case as stated.

Question 460

A Terraform platform team is coordinating 3 independent decisions. Workstream A: A migration changes a backend location but the team must preserve all existing state bindings. and Workstream B: A configuration has two aliases of the same cloud provider and both use different regions; one resource must be created outside the default region. and Workstream C: A developer defines a subnet inventory in which every subnet has cidr, zone, and public attributes, and needs reliable shape checking. Select exactly 3 actions, one addressing each distinct workstream.

  1. Set provider = aws.secondary on that resource, referencing the aliased provider configuration.
  2. Use the cloud integration block for workspace mapping and authenticate with terraform login securely.
  3. Create an HCP Terraform workspace and configure an appropriate remote execution workflow with secure credentials.
  4. Use terraform show -json on the state or saved plan with proper access controls.
  5. Back up the current state and use terraform init -migrate-state when moving to the newly configured backend.
  6. Use an object type constraint within a map or list collection with named attribute types.

Explanation

Correct Answers

A:

For the workstream in which a configuration has two aliases of the same cloud provider and both use different regions; one resource must be created outside the default region, use this action: Set provider = aws.secondary on that resource, referencing the aliased provider configuration. Explicit provider selection lets a resource use a non-default provider configuration. Verify: The planned resource address resolves through the secondary provider while unqualified resources use the default. Limitation: Alias names are Terraform-local configuration references, not separate plugin versions.

E:

For the workstream in which a migration changes a backend location but the team must preserve all existing state bindings, use this action: Back up the current state and use terraform init -migrate-state when moving to the newly configured backend. Backend migration must transfer the existing state, not simply change where Terraform searches for it. Verify: The destination backend reflects the prior managed resource addresses and lineage after migration. Limitation: Misconfigured credentials or failed migration should block an apply rather than trigger new resource creation.

F:

For the workstream in which a developer defines a subnet inventory in which every subnet has cidr, zone, and public attributes, and needs reliable shape checking, use this action: Use an object type constraint within a map or list collection with named attribute types. Structured type constraints describe expected nested data and improve module interfaces. Verify: Invalid records with wrong attribute types fail validation rather than causing obscure downstream errors. Limitation: An object type is not interchangeable with any arbitrary map if its declared attributes differ.

Incorrect Answers

B:

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.

C:

This action is appropriate instead for a different, unlisted requirement: A small team needs managed Terraform state and remotely executed infrastructure runs with shared visibility rather than running only from laptops. It would be checked by: Plans and applies run under the HCP workspace and its state versions are centrally accessible to authorized users. 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: An engineer wants a machine-readable view of the current Terraform state while building an inventory report. It would be checked by: The JSON structure can be parsed for relevant addresses and outputs by authorized tooling. 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.