100% Latest & Updated HashiCorp Terraform Associate 004 Practice Test Questions, Exam Dumps & Verified Answers!
30 Days Free Updates, Instant Download!
Question 80
A Terraform platform team is coordinating 3 independent decisions. Workstream A: An operator asks why deleting one resource stanza from a configuration can cause a production object to be proposed for destruction. and Workstream B: A deployment needs to choose a service hostname based on whether the environment is production. and Workstream C: An operations team edits cloud VM tags manually, and normal Terraform plan shows an unexpected change even though HCL has not changed. Select exactly 3 actions, one addressing each distinct workstream.
- Use a Terraform root module that explicitly declares tracked resources and reconcile it through Terraform state.
- Interpret the refreshed plan as detected drift and decide whether to restore declared tags or intentionally update configuration.
- Use a conditional expression over a declared environment variable to select the appropriate hostname.
- Select suitable Azure and monitoring providers and declare both systems through one Terraform root module.
- Explain that Terraform compares current configuration with state bindings and plans to reconcile deleted declarations.
- Specify a reviewed registry-module version constraint in the module block.
Explanation
Correct Answers
B:For the workstream in which an operations team edits cloud VM tags manually, and normal Terraform plan shows an unexpected change even though HCL has not changed, use this action: Interpret the refreshed plan as detected drift and decide whether to restore declared tags or intentionally update configuration. Refreshing known remote objects exposes differences between actual and declared desired state. Verify: The reviewed plan explains which observed remote attributes differ from desired HCL. Limitation: Not every remote change is actionable drift; provider-computed attributes and intentional shared ownership need consideration.
C:For the workstream in which a deployment needs to choose a service hostname based on whether the environment is production, use this action: Use a conditional expression over a declared environment variable to select the appropriate hostname. Conditional expressions select one of two typed values based on a boolean condition. Verify: The plan selects the production hostname only when the condition evaluates true. Limitation: Both branches need compatible types and the condition must be a boolean expression.
E:For the workstream in which an operator asks why deleting one resource stanza from a configuration can cause a production object to be proposed for destruction, use this action: Explain that Terraform compares current configuration with state bindings and plans to reconcile deleted declarations. State allows Terraform to map declared resource instances to existing real objects and reason about changes. Verify: A plan shows the bound object as no longer desired when its resource address disappears from configuration. Limitation: A state binding records managed identity; it is not itself a backup of the remote service.
Incorrect Answers
A:This action is appropriate instead for a different, unlisted requirement: An audit team asks whether applying a YAML-looking file automatically turns ad hoc server purchases into managed infrastructure. It would be checked by: The plan and state distinguish managed resource instances from unmanaged manual purchases. 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 company uses Azure for application workloads and a SaaS provider for monitoring, and wants to avoid managing two separate IaC languages. It would be checked by: Plan output contains the cloud deployment and monitoring integrations with clear provider ownership. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.
F:This action is appropriate instead for a different, unlisted requirement: A team 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.
Question 81
An infrastructure team faces this specific situation: Two engineers share one project but each stores a different local state file and independently sees new resources in their plans. Which Terraform action most directly satisfies the requirement?
- Declare separate supported Kubernetes and DNS providers and use their respective resource types in the same root module.
- Move to an appropriate shared backend with concurrency controls so both plans use the same authoritative state.
- Run terraform init -upgrade after reviewing the intended provider compatibility change.
- Use the provider's supported environment or workload identity authentication mechanism rather than embedding credential literals.
Explanation
Correct Answer
B: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.
Incorrect Answers
A:This is linked to a different situation: A newly created project uses both a Kubernetes cluster and cloud DNS records, and the same release should manage them coherently. There the relevant decision is: Declare separate supported Kubernetes and DNS providers and use their respective resource types in the same root module. For the question's actual requirement — Two engineers share one project but each stores a different local state file and independently sees new resources in their plans. — the specifically relevant decision is: Move to an appropriate shared backend with concurrency controls so both plans use the same authoritative state. It would therefore not resolve or assess the case as stated.
C:This is linked to a different situation: A project intentionally needs a newer provider version allowed by its constraints, but init keeps reusing the version recorded in the lock file. There the relevant decision is: Run terraform init -upgrade after reviewing the intended provider compatibility change. For the question's actual requirement — Two engineers share one project but each stores a different local state file and independently sees new resources in their plans. — the specifically relevant decision is: Move to an appropriate shared backend with concurrency controls so both plans use the same authoritative state. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: A newly introduced provider plugin needs credentials but the team wants to avoid including long-lived secrets in tracked files. There the relevant decision is: Use the provider's supported environment or workload identity authentication mechanism rather than embedding credential literals. For the question's actual requirement — Two engineers share one project but each stores a different local state file and independently sees new resources in their plans. — the specifically relevant decision is: Move to an appropriate shared backend with concurrency controls so both plans use the same authoritative state. It would therefore not resolve or assess the case as stated.
Question 82
A reviewer is confirming a change for the following use case: Two engineers share one project but each stores a different local state file and independently sees new resources in their plans. The implementation follows this approach: Move to an appropriate shared backend with concurrency controls so both plans use the same authoritative state. Which observation or acceptance test most directly verifies the intended result?
- The child resource plans with the specifically mapped source and destination provider aliases.
- The plan identifies primary and recovery resources using the intended regional provider instances.
- Both operators observe the same resource addresses and coordinated state updates.
- The lock entry identifies the intended registry namespace, provider type, and selected version.
Explanation
Correct Answer
C:Acceptance evidence: Both operators observe the same resource addresses and coordinated state updates. It validates the proposed action, move to an appropriate shared backend with concurrency controls so both plans use the same authoritative state, because state carries the managed resource bindings, so isolated state files can cause conflicting views. Remaining limitation: A backend cannot reconcile genuinely conflicting code branches or permissions by itself.
Incorrect Answers
A:This is linked to a different situation: A child network module expects two AWS provider aliases, but the root module has only passed its default provider. There the relevant acceptance is: The child resource plans with the specifically mapped source and destination provider aliases. For the question's actual requirement — Two engineers share one project but each stores a different local state file and independently sees new resources in their plans. — the specifically relevant acceptance is: Both operators observe the same resource addresses and coordinated state updates. It would therefore not resolve or assess the case as stated.
B:This is linked to a different situation: An infrastructure release creates AWS resources in two regions, with a disaster-recovery instance explicitly assigned to the second region. There the relevant acceptance is: The plan identifies primary and recovery resources using the intended regional provider instances. For the question's actual requirement — Two engineers share one project but each stores a different local state file and independently sees new resources in their plans. — the specifically relevant acceptance is: Both operators observe the same resource addresses and coordinated state updates. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: A service module declares use of a third-party provider but two different namespaces publish plugins with the same local name. There the relevant acceptance is: The lock entry identifies the intended registry namespace, provider type, and selected version. For the question's actual requirement — Two engineers share one project but each stores a different local state file and independently sees new resources in their plans. — the specifically relevant acceptance is: Both operators observe the same resource addresses and coordinated state updates. It would therefore not resolve or assess the case as stated.
Question 83
Consider a proposed solution for this requirement: Two engineers share one project but each stores a different local state file and independently sees new resources in their plans. The team plans to do the following: Move to an appropriate shared backend with concurrency controls so both plans use the same authoritative state. Which limitation or operational caveat must remain in the review?
- The dependency lock file locks provider selections, not an immutable Terraform CLI binary version.
- A backend cannot reconcile genuinely conflicting code branches or permissions by itself.
- The existence of a provider does not prove its API endpoints or credentials are reachable in every environment.
- The exact environment variable or identity mechanism is provider-specific and must be checked in its documentation.
Explanation
Correct Answer
B:The limitation is a backend cannot reconcile genuinely conflicting code branches or permissions by itself. The proposed change is move to an appropriate shared backend with concurrency controls so both plans use the same authoritative state. Validate it by checking both operators observe the same resource addresses and coordinated state updates. State carries the managed resource bindings, so isolated state files can cause conflicting views.
Incorrect Answers
A:This is linked to a different situation: A team pins the AWS provider below 6.0 but a new contractor runs init and unexpectedly resolves a higher patch than other developers. There the relevant limitation is: The dependency lock file locks provider selections, not an immutable Terraform CLI binary version. For the question's actual requirement — Two engineers share one project but each stores a different local state file and independently sees new resources in their plans. — the specifically relevant limitation is: A backend cannot reconcile genuinely conflicting code branches or permissions by itself. It would therefore not resolve or assess the case as stated.
C:This is linked to a different situation: A newly created project uses both a Kubernetes cluster and cloud DNS records, and the same release should manage them coherently. There the relevant limitation is: The existence of a provider does not prove its API endpoints or credentials are reachable in every environment. For the question's actual requirement — Two engineers share one project but each stores a different local state file and independently sees new resources in their plans. — the specifically relevant limitation is: A backend cannot reconcile genuinely conflicting code branches or permissions by itself. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: A newly introduced provider plugin needs credentials but the team wants to avoid including long-lived secrets in tracked files. There the relevant limitation is: The exact environment variable or identity mechanism is provider-specific and must be checked in its documentation. For the question's actual requirement — Two engineers share one project but each stores a different local state file and independently sees new resources in their plans. — the specifically relevant limitation is: A backend cannot reconcile genuinely conflicting code branches or permissions by itself. It would therefore not resolve or assess the case as stated.
Question 84
The team is reviewing a Terraform implementation for this case: Two engineers share one project but each stores a different local state file and independently sees new resources in their plans. Which tempting assumption would be specifically incorrect for this proposed implementation?
- Delete state files to force a provider upgrade rather than updating dependency selections.
- Write static credentials into a versioned provider block because Terraform marks all input strings secret.
- Assume identical .tf files guarantee identical resource identity even with unrelated local state files.
- Expect every resource to automatically use whichever provider alias was declared last.
Explanation
Correct Answer
C:Reject the assumption: Assume identical .tf files guarantee identical resource identity even with unrelated local state files. Instead, 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. Acceptance evidence: Both operators observe the same resource addresses and coordinated state updates.
Incorrect Answers
A:This is linked to a different situation: A project intentionally needs a newer provider version allowed by its constraints, but init keeps reusing the version recorded in the lock file. There the relevant misconception is: Delete state files to force a provider upgrade rather than updating dependency selections. For the question's actual requirement — Two engineers share one project but each stores a different local state file and independently sees new resources in their plans. — the specifically relevant misconception is: Assume identical .tf files guarantee identical resource identity even with unrelated local state files. It would therefore not resolve or assess the case as stated.
B:This is linked to a different situation: A newly introduced provider plugin needs credentials but the team wants to avoid including long-lived secrets in tracked files. There the relevant misconception is: Write static credentials into a versioned provider block because Terraform marks all input strings secret. For the question's actual requirement — Two engineers share one project but each stores a different local state file and independently sees new resources in their plans. — the specifically relevant misconception is: Assume identical .tf files guarantee identical resource identity even with unrelated local state files. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: A configuration has two aliases of the same cloud provider and both use different regions; one resource must be created outside the default region. There the relevant misconception is: Expect every resource to automatically use whichever provider alias was declared last. For the question's actual requirement — Two engineers share one project but each stores a different local state file and independently sees new resources in their plans. — the specifically relevant misconception is: Assume identical .tf files guarantee identical resource identity even with unrelated local state files. It would therefore not resolve or assess the case as stated.
Question 85
A Terraform platform team is coordinating 2 independent decisions. Workstream A: Two engineers share one project but each stores a different local state file and independently sees new resources in their plans. and Workstream B: A pipeline produces a list of service names with inconsistent letter casing and needs normalized DNS labels. Select exactly 2 actions, one addressing each distinct workstream.
- Refer to the indexed module instance, such as module.worker[1].endpoint, with an appropriate count expression.
- Run terraform validate after successful initialization to check syntax and internal configuration consistency.
- Use a for expression with lower() to derive normalized names from the input collection.
- Use an advisory policy enforcement setting on the learning workspaces and monitor the warnings.
- Move to an appropriate shared backend with concurrency controls so both plans use the same authoritative state.
Explanation
Correct Answers
C:For the workstream in which a pipeline produces a list of service names with inconsistent letter casing and needs normalized DNS labels, use this action: Use a for expression with lower() to derive normalized names from the input collection. For expressions transform Terraform values during evaluation; functions supply operations such as case conversion. Verify: The computed list contains each intended service name normalized consistently. Limitation: Collision after normalization must be handled explicitly; lower() alone does not ensure uniqueness.
E: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.
Incorrect Answers
A: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.
B:This option addresses a separate requirement: A developer adds a missing required argument to a resource definition and needs a fast validation before planning. Evidence for that other requirement would be the validate command reports whether the configuration passes Terraform's static checks; neither listed workstream asks for it.
D:This option addresses a separate requirement: A security team wants engineers to see policy violations without initially blocking learning-environment applies. Evidence for that other requirement would be violating plans produce visible advisory policy findings while runs remain allowed to continue; neither listed workstream asks for it.
Question 86
An infrastructure team faces this specific situation: A storage bucket exists in the cloud, but Terraform proposes creating another bucket with the intended name because its state has no binding. Which Terraform action most directly satisfies the requirement?
- Run terraform init -upgrade after reviewing the intended provider compatibility change.
- Commit .terraform.lock.hcl and use required_providers version constraints to keep provider selection reproducible.
- Use the provider's supported environment or workload identity authentication mechanism rather than embedding credential literals.
- Import the existing bucket into an appropriate resource address after writing matching configuration.
Explanation
Correct Answer
D:Import the existing bucket into an appropriate resource address after writing matching configuration. Import establishes an address-to-object state binding for an already-created resource. Verify: The state lists the imported address, and a subsequent plan can be evaluated for unintended differences. Limitation: Import does not invent complete desired configuration or guarantee a no-op plan.
Incorrect Answers
A:This is linked to a different situation: A project intentionally needs a newer provider version allowed by its constraints, but init keeps reusing the version recorded in the lock file. There the relevant decision is: Run terraform init -upgrade after reviewing the intended provider compatibility change. For the question's actual requirement — A storage bucket exists in the cloud, but Terraform proposes creating another bucket with the intended name because its state has no binding. — the specifically relevant decision is: Import the existing bucket into an appropriate resource address after writing matching configuration. It would therefore not resolve or assess the case as stated.
B:This is linked to a different situation: A team pins the AWS provider below 6.0 but a new contractor runs init and unexpectedly resolves a higher patch than other developers. There the relevant decision is: Commit .terraform.lock.hcl and use required_providers version constraints to keep provider selection reproducible. For the question's actual requirement — A storage bucket exists in the cloud, but Terraform proposes creating another bucket with the intended name because its state has no binding. — the specifically relevant decision is: Import the existing bucket into an appropriate resource address after writing matching configuration. It would therefore not resolve or assess the case as stated.
C:This is linked to a different situation: A newly introduced provider plugin needs credentials but the team wants to avoid including long-lived secrets in tracked files. There the relevant decision is: Use the provider's supported environment or workload identity authentication mechanism rather than embedding credential literals. For the question's actual requirement — A storage bucket exists in the cloud, but Terraform proposes creating another bucket with the intended name because its state has no binding. — the specifically relevant decision is: Import the existing bucket into an appropriate resource address after writing matching configuration. It would therefore not resolve or assess the case as stated.
Question 87
A reviewer is confirming a change for the following use case: A storage bucket exists in the cloud, but Terraform proposes creating another bucket with the intended name because its state has no binding. The implementation follows this approach: Import the existing bucket into an appropriate resource address after writing matching configuration. Which observation or acceptance test most directly verifies the intended result?
- The chosen provider version and checksums are recorded in the lock file after initialization.
- The planned resource address resolves through the secondary provider while unqualified resources use the default.
- The state lists the imported address, and a subsequent plan can be evaluated for unintended differences.
- The provider authenticates through the supported runtime identity without secrets appearing in committed configuration.
Explanation
Correct Answer
C:Acceptance evidence: The state lists the imported address, and a subsequent plan can be evaluated for unintended differences. It validates the proposed action, import the existing bucket into an appropriate resource address after writing matching configuration, because import establishes an address-to-object state binding for an already-created resource. Remaining limitation: Import does not invent complete desired configuration or guarantee a no-op plan.
Incorrect Answers
A:This is linked to a different situation: A team pins the AWS provider below 6.0 but a new contractor runs init and unexpectedly resolves a higher patch than other developers. There the relevant acceptance is: The chosen provider version and checksums are recorded in the lock file after initialization. For the question's actual requirement — A storage bucket exists in the cloud, but Terraform proposes creating another bucket with the intended name because its state has no binding. — the specifically relevant acceptance is: The state lists the imported address, and a subsequent plan can be evaluated for unintended differences. It would therefore not resolve or assess the case as stated.
B:This is linked to a different situation: A configuration has two aliases of the same cloud provider and both use different regions; one resource must be created outside the default region. There the relevant acceptance is: The planned resource address resolves through the secondary provider while unqualified resources use the default. For the question's actual requirement — A storage bucket exists in the cloud, but Terraform proposes creating another bucket with the intended name because its state has no binding. — the specifically relevant acceptance is: The state lists the imported address, and a subsequent plan can be evaluated for unintended differences. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: A newly introduced provider plugin needs credentials but the team wants to avoid including long-lived secrets in tracked files. There the relevant acceptance is: The provider authenticates through the supported runtime identity without secrets appearing in committed configuration. For the question's actual requirement — A storage bucket exists in the cloud, but Terraform proposes creating another bucket with the intended name because its state has no binding. — the specifically relevant acceptance is: The state lists the imported address, and a subsequent plan can be evaluated for unintended differences. It would therefore not resolve or assess the case as stated.
Question 88
Consider a proposed solution for this requirement: A storage bucket exists in the cloud, but Terraform proposes creating another bucket with the intended name because its state has no binding. The team plans to do the following: Import the existing bucket into an appropriate resource address after writing matching configuration. Which limitation or operational caveat must remain in the review?
- The dependency lock file locks provider selections, not an immutable Terraform CLI binary version.
- Import does not invent complete desired configuration or guarantee a no-op plan.
- Do not put shared provider configuration blocks inside a modern reusable child module to solve this mapping.
- Upgrading may change provider behavior, so review plans and release notes before applying.
Explanation
Correct Answer
B:The limitation is import does not invent complete desired configuration or guarantee a no-op plan. The proposed change is import the existing bucket into an appropriate resource address after writing matching configuration. Validate it by checking the state lists the imported address, and a subsequent plan can be evaluated for unintended differences. Import establishes an address-to-object state binding for an already-created resource.
Incorrect Answers
A:This is linked to a different situation: A team pins the AWS provider below 6.0 but a new contractor runs init and unexpectedly resolves a higher patch than other developers. There the relevant limitation is: The dependency lock file locks provider selections, not an immutable Terraform CLI binary version. For the question's actual requirement — A storage bucket exists in the cloud, but Terraform proposes creating another bucket with the intended name because its state has no binding. — the specifically relevant limitation is: Import does not invent complete desired configuration or guarantee a no-op plan. It would therefore not resolve or assess the case as stated.
C:This is linked to a different situation: A security team calls the same reusable child module twice, once under each of two cloud accounts. There the relevant limitation is: Do not put shared provider configuration blocks inside a modern reusable child module to solve this mapping. For the question's actual requirement — A storage bucket exists in the cloud, but Terraform proposes creating another bucket with the intended name because its state has no binding. — the specifically relevant limitation is: Import does not invent complete desired configuration or guarantee a no-op plan. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: A project intentionally needs a newer provider version allowed by its constraints, but init keeps reusing the version recorded in the lock file. There the relevant limitation is: Upgrading may change provider behavior, so review plans and release notes before applying. For the question's actual requirement — A storage bucket exists in the cloud, but Terraform proposes creating another bucket with the intended name because its state has no binding. — the specifically relevant limitation is: Import does not invent complete desired configuration or guarantee a no-op plan. It would therefore not resolve or assess the case as stated.
Question 89
The team is reviewing a Terraform implementation for this case: A storage bucket exists in the cloud, but Terraform proposes creating another bucket with the intended name because its state has no binding. Which tempting assumption would be specifically incorrect for this proposed implementation?
- Assume a provider's short local alias uniquely identifies its publisher across registries.
- Assume the child automatically inherits all aliases merely because it inherits an unaliased provider.
- Assume required_providers constraints alone always choose the identical provider build for every run.
- Edit a JSON state file by hand as the normal way to make an unmanaged bucket Terraform-managed.
Explanation
Correct Answer
D:Reject the assumption: Edit a JSON state file by hand as the normal way to make an unmanaged bucket Terraform-managed. Instead, import the existing bucket into an appropriate resource address after writing matching configuration. Import establishes an address-to-object state binding for an already-created resource. Acceptance evidence: The state lists the imported address, and a subsequent plan can be evaluated for unintended differences.
Incorrect Answers
A:This is linked to a different situation: A service module declares use of a third-party provider but two different namespaces publish plugins with the same local name. There the relevant misconception is: Assume a provider's short local alias uniquely identifies its publisher across registries. For the question's actual requirement — A storage bucket exists in the cloud, but Terraform proposes creating another bucket with the intended name because its state has no binding. — the specifically relevant misconception is: Edit a JSON state file by hand as the normal way to make an unmanaged bucket Terraform-managed. It would therefore not resolve or assess the case as stated.
B:This is linked to a different situation: A child network module expects two AWS provider aliases, but the root module has only passed its default provider. There the relevant misconception is: Assume the child automatically inherits all aliases merely because it inherits an unaliased provider. For the question's actual requirement — A storage bucket exists in the cloud, but Terraform proposes creating another bucket with the intended name because its state has no binding. — the specifically relevant misconception is: Edit a JSON state file by hand as the normal way to make an unmanaged bucket Terraform-managed. It would therefore not resolve or assess the case as stated.
C:This is linked to a different situation: A team pins the AWS provider below 6.0 but a new contractor runs init and unexpectedly resolves a higher patch than other developers. There the relevant misconception is: Assume required_providers constraints alone always choose the identical provider build for every run. For the question's actual requirement — A storage bucket exists in the cloud, but Terraform proposes creating another bucket with the intended name because its state has no binding. — the specifically relevant misconception is: Edit a JSON state file by hand as the normal way to make an unmanaged bucket Terraform-managed. It would therefore not resolve or assess the case as stated.
Question 90
A Terraform platform team is coordinating 3 independent decisions. Workstream A: A storage bucket exists in the cloud, but Terraform proposes creating another bucket with the intended name because its state has no binding. and Workstream B: A firewall rule should be provisioned only after a policy attachment exists, but the rule's arguments do not reference that attachment. and Workstream C: A company intentionally altered remote settings and wants Terraform state to reflect the real objects without proposing configuration-driven remediation yet. Select exactly 3 actions, one addressing each distinct workstream.
- Review the HCL change through version control and inspect a Terraform execution plan before authorized apply.
- Create a child module with declared input variables, resource blocks, and output values, then invoke it from a root module.
- Use for_each on the module block and reference module.stack["test"].endpoint.
- Import the existing bucket into an appropriate resource address after writing matching configuration.
- Run a refresh-only plan, review its state changes, and apply refresh-only if the update is appropriate.
- Add an explicit depends_on referencing the policy attachment resource for the hidden operational dependency.
Explanation
Correct Answers
D:For the workstream in which a storage bucket exists in the cloud, but Terraform proposes creating another bucket with the intended name because its state has no binding, use this action: Import the existing bucket into an appropriate resource address after writing matching configuration. Import establishes an address-to-object state binding for an already-created resource. Verify: The state lists the imported address, and a subsequent plan can be evaluated for unintended differences. Limitation: Import does not invent complete desired configuration or guarantee a no-op plan.
E:For the workstream in which a company intentionally altered remote settings and wants Terraform state to reflect the real objects without proposing configuration-driven remediation yet, use this action: Run a refresh-only plan, review its state changes, and apply refresh-only if the update is appropriate. Refresh-only updates Terraform's recorded understanding rather than enforcing desired configuration. Verify: State and root outputs synchronize with observed remote data without changing the cloud object itself. Limitation: Refresh-only does not make configuration match reality or prevent later normal plans from proposing remediation.
F:For the workstream in which a firewall rule should be provisioned only after a policy attachment exists, but the rule's arguments do not reference that attachment, use this action: Add an explicit depends_on referencing the policy attachment resource for the hidden operational dependency. depends_on expresses ordering when Terraform cannot infer it from attribute references. Verify: The dependency graph orders the attachment action before the dependent rule operation. Limitation: Explicit dependencies should be limited to real hidden dependencies; excessive depends_on can make plans conservative.
Incorrect Answers
A:This action is appropriate instead for a different, unlisted requirement: An operations group wants four engineers to propose a subnet change without all four immediately modifying production. It would be checked by: A pull request includes configuration differences and a plan describing expected resource mutations. 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 is packaging a repeated VPC pattern and wants a stable interface for internal consumers. It would be checked by: Consumers can pass environment-specific inputs and receive selected outputs without editing child internals. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.
C:This action is appropriate instead for a different, unlisted requirement: A module is instantiated for each environment in a map, and the root needs the output for the test environment. It would be checked by: The keyed module instance exposes only the test environment's selected output. 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