100% Latest & Updated HashiCorp Terraform Associate 004 Practice Test Questions, Exam Dumps & Verified Answers!
30 Days Free Updates, Instant Download!
Question 60
A Terraform platform team is coordinating 3 independent decisions. Workstream A: A newly introduced provider plugin needs credentials but the team wants to avoid including long-lived secrets in tracked files. and Workstream B: A module emits an ordered list of three subnet IDs aligned with ordered availability zones and consumers depend on position. and Workstream C: A new environment needs to save state in a specific shared backend, and the team attempts to write backend settings under a resource block. Select exactly 3 actions, one addressing each distinct workstream.
- Declare one backend block inside terraform and reinitialize the working directory.
- Disable or lower TF_LOG after collecting the targeted diagnostic evidence.
- Declare the input in the child and supply environment = var.environment in the root's module call.
- Reference the local path with source = "./modules/security" inside the module block.
- Use a list(string) or tuple with explicit ordering semantics rather than a set.
- Use the provider's supported environment or workload identity authentication mechanism rather than embedding credential literals.
Explanation
Correct Answers
A:For the workstream in which a new environment needs to save state in a specific shared backend, and the team attempts to write backend settings under a resource block, use this action: Declare one backend block inside terraform and reinitialize the working directory. A terraform backend configuration controls state location independently of managed resource blocks. Verify: terraform init reports the selected backend and plan reads the correct shared state. Limitation: Backend arguments cannot reference ordinary input variables or data-source attributes.
E:For the workstream in which a module emits an ordered list of three subnet IDs aligned with ordered availability zones and consumers depend on position, use this action: Use a list(string) or tuple with explicit ordering semantics rather than a set. List and tuple values preserve positional meaning; sets do not. Verify: The first, second, and third output elements correspond to documented ordered subnet assignments. Limitation: Order-sensitive outputs should not be built from unordered map iteration without intentional sorting.
F:For the workstream in which a newly introduced provider plugin needs credentials but the team wants to avoid including long-lived secrets in tracked files, use this action: Use the provider's supported environment or workload identity authentication mechanism rather than embedding credential literals. Providers manage their own API connections; secure credential sourcing is separate from Terraform's HCL syntax. Verify: The provider authenticates through the supported runtime identity without secrets appearing in committed configuration. Limitation: The exact environment variable or identity mechanism is provider-specific and must be checked in its documentation.
Incorrect Answers
B:This action is appropriate instead for a different, unlisted requirement: An operator leaves TF_LOG=TRACE enabled in production for all runs and sees excessive potentially sensitive logs. It would be checked by: Subsequent normal runs no longer emit verbose tracing to the same log destination. 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 child module uses var.environment but the root module declares an environment variable of the same name and passes nothing. It would be checked by: Planning resolves the child's environment value from the explicit module call. 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 security group module lives in the local modules/security directory of the same versioned repository. It would be checked by: Terraform reads the local child module without fetching it from a remote registry. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.
Question 61
An infrastructure team faces this specific situation: An infrastructure release creates AWS resources in two regions, with a disaster-recovery instance explicitly assigned to the second region. Which Terraform action most directly satisfies the requirement?
- Run terraform init -upgrade after reviewing the intended provider compatibility change.
- Distinguish provider-version lock metadata from terraform.tfstate and protect the actual state through suitable backend controls.
- Set provider = aws.secondary on that resource, referencing the aliased provider configuration.
- Configure default and aliased AWS providers and assign the disaster-recovery resource to the alias.
Explanation
Correct Answer
D:Configure default and aliased AWS providers and assign the disaster-recovery resource to the alias. Multiple provider configurations allow one plugin to manage distinct endpoints or regions. Verify: The plan identifies primary and recovery resources using the intended regional provider instances. Limitation: Resources cannot infer an alias from a tag or name; it must be referenced by Terraform configuration.
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 — An infrastructure release creates AWS resources in two regions, with a disaster-recovery instance explicitly assigned to the second region. — the specifically relevant decision is: Configure default and aliased AWS providers and assign the disaster-recovery resource to the alias. It would therefore not resolve or assess the case as stated.
B:This is linked to a different situation: A team considers keeping .terraform.lock.hcl in a secrets vault because it thinks the file is the primary infrastructure state store. There the relevant decision is: Distinguish provider-version lock metadata from terraform.tfstate and protect the actual state through suitable backend controls. For the question's actual requirement — An infrastructure release creates AWS resources in two regions, with a disaster-recovery instance explicitly assigned to the second region. — the specifically relevant decision is: Configure default and aliased AWS providers and assign the disaster-recovery resource to the alias. It would therefore not resolve or assess the case as stated.
C: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 decision is: Set provider = aws.secondary on that resource, referencing the aliased provider configuration. For the question's actual requirement — An infrastructure release creates AWS resources in two regions, with a disaster-recovery instance explicitly assigned to the second region. — the specifically relevant decision is: Configure default and aliased AWS providers and assign the disaster-recovery resource to the alias. It would therefore not resolve or assess the case as stated.
Question 62
A reviewer is confirming a change for the following use case: An infrastructure release creates AWS resources in two regions, with a disaster-recovery instance explicitly assigned to the second region. The implementation follows this approach: Configure default and aliased AWS providers and assign the disaster-recovery resource to the alias. Which observation or acceptance test most directly verifies the intended result?
- Init obtains the required plugin; plan uses the configured provider instance for API calls.
- The plan identifies primary and recovery resources using the intended regional provider instances.
- The state lists the imported address, and a subsequent plan can be evaluated for unintended differences.
- Both operators observe the same resource addresses and coordinated state updates.
Explanation
Correct Answer
B:Acceptance evidence: The plan identifies primary and recovery resources using the intended regional provider instances. It validates the proposed action, configure default and aliased AWS providers and assign the disaster-recovery resource to the alias, because multiple provider configurations allow one plugin to manage distinct endpoints or regions. Remaining limitation: Resources cannot infer an alias from a tag or name; it must be referenced by Terraform configuration.
Incorrect Answers
A:This is linked to a different situation: An engineer thinks the provider block installs the AWS provider and a resource block selects the AWS account by itself. There the relevant acceptance is: Init obtains the required plugin; plan uses the configured provider instance for API calls. For the question's actual requirement — An infrastructure release creates AWS resources in two regions, with a disaster-recovery instance explicitly assigned to the second region. — the specifically relevant acceptance is: The plan identifies primary and recovery resources using the intended regional provider instances. It would therefore not resolve or assess the case as stated.
C:This is linked to a different situation: A storage bucket exists in the cloud, but Terraform proposes creating another bucket with the intended name because its state has no binding. There the relevant acceptance is: The state lists the imported address, and a subsequent plan can be evaluated for unintended differences. For the question's actual requirement — An infrastructure release creates AWS resources in two regions, with a disaster-recovery instance explicitly assigned to the second region. — the specifically relevant acceptance is: The plan identifies primary and recovery resources using the intended regional provider instances. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: Two engineers share one project but each stores a different local state file and independently sees new resources in their plans. There the relevant acceptance is: Both operators observe the same resource addresses and coordinated state updates. For the question's actual requirement — An infrastructure release creates AWS resources in two regions, with a disaster-recovery instance explicitly assigned to the second region. — the specifically relevant acceptance is: The plan identifies primary and recovery resources using the intended regional provider instances. It would therefore not resolve or assess the case as stated.
Question 63
Consider a proposed solution for this requirement: An infrastructure release creates AWS resources in two regions, with a disaster-recovery instance explicitly assigned to the second region. The team plans to do the following: Configure default and aliased AWS providers and assign the disaster-recovery resource to the alias. Which limitation or operational caveat must remain in the review?
- A state binding records managed identity; it is not itself a backup of the remote service.
- Import does not invent complete desired configuration or guarantee a no-op plan.
- Resources cannot infer an alias from a tag or name; it must be referenced by Terraform configuration.
- Provider settings do not guarantee permission to create any resource without valid credentials and IAM rights.
Explanation
Correct Answer
C:The limitation is resources cannot infer an alias from a tag or name; it must be referenced by Terraform configuration. The proposed change is configure default and aliased AWS providers and assign the disaster-recovery resource to the alias. Validate it by checking the plan identifies primary and recovery resources using the intended regional provider instances. Multiple provider configurations allow one plugin to manage distinct endpoints or regions.
Incorrect Answers
A:This is linked to a different situation: An operator asks why deleting one resource stanza from a configuration can cause a production object to be proposed for destruction. There the relevant limitation is: A state binding records managed identity; it is not itself a backup of the remote service. For the question's actual requirement — An infrastructure release creates AWS resources in two regions, with a disaster-recovery instance explicitly assigned to the second region. — the specifically relevant limitation is: Resources cannot infer an alias from a tag or name; it must be referenced by Terraform configuration. It would therefore not resolve or assess the case as stated.
B:This is linked to a different situation: A storage bucket exists in the cloud, but Terraform proposes creating another bucket with the intended name because its state has no binding. There the relevant limitation is: Import does not invent complete desired configuration or guarantee a no-op plan. For the question's actual requirement — An infrastructure release creates AWS resources in two regions, with a disaster-recovery instance explicitly assigned to the second region. — the specifically relevant limitation is: Resources cannot infer an alias from a tag or name; it must be referenced by Terraform configuration. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: An engineer thinks the provider block installs the AWS provider and a resource block selects the AWS account by itself. There the relevant limitation is: Provider settings do not guarantee permission to create any resource without valid credentials and IAM rights. For the question's actual requirement — An infrastructure release creates AWS resources in two regions, with a disaster-recovery instance explicitly assigned to the second region. — the specifically relevant limitation is: Resources cannot infer an alias from a tag or name; it must be referenced by Terraform configuration. It would therefore not resolve or assess the case as stated.
Question 64
The team is reviewing a Terraform implementation for this case: An infrastructure release creates AWS resources in two regions, with a disaster-recovery instance explicitly assigned to the second region. Which tempting assumption would be specifically incorrect for this proposed implementation?
- Write static credentials into a versioned provider block because Terraform marks all input strings secret.
- Assume a provider's short local alias uniquely identifies its publisher across registries.
- Pass region as an unsupported meta-argument to each resource instead of configuring provider instances.
- Assume identical .tf files guarantee identical resource identity even with unrelated local state files.
Explanation
Correct Answer
C:Reject the assumption: Pass region as an unsupported meta-argument to each resource instead of configuring provider instances. Instead, configure default and aliased AWS providers and assign the disaster-recovery resource to the alias. Multiple provider configurations allow one plugin to manage distinct endpoints or regions. Acceptance evidence: The plan identifies primary and recovery resources using the intended regional provider instances.
Incorrect Answers
A: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 — An infrastructure release creates AWS resources in two regions, with a disaster-recovery instance explicitly assigned to the second region. — the specifically relevant misconception is: Pass region as an unsupported meta-argument to each resource instead of configuring provider instances. It would therefore not resolve or assess the case as stated.
B: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 — An infrastructure release creates AWS resources in two regions, with a disaster-recovery instance explicitly assigned to the second region. — the specifically relevant misconception is: Pass region as an unsupported meta-argument to each resource instead of configuring provider instances. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: Two engineers share one project but each stores a different local state file and independently sees new resources in their plans. There the relevant misconception is: Assume identical .tf files guarantee identical resource identity even with unrelated local state files. For the question's actual requirement — An infrastructure release creates AWS resources in two regions, with a disaster-recovery instance explicitly assigned to the second region. — the specifically relevant misconception is: Pass region as an unsupported meta-argument to each resource instead of configuring provider instances. It would therefore not resolve or assess the case as stated.
Question 65
A Terraform platform team is coordinating 2 independent decisions. Workstream A: An infrastructure release creates AWS resources in two regions, with a disaster-recovery instance explicitly assigned to the second region. and Workstream B: A configuration needs a map from environment names to individually selected instance classes, with each value a string. Select exactly 2 actions, one addressing each distinct workstream.
- Declare map(string) as the input type and select an entry by key, such as var.instance_class["staging"].
- Configure default and aliased AWS providers and assign the disaster-recovery resource to the alias.
- Disable or lower TF_LOG after collecting the targeted diagnostic evidence.
- Use terraform init -migrate-state when intending to copy existing state to the new backend.
- Use terraform show -json on the state or saved plan with proper access controls.
Explanation
Correct Answers
A:For the workstream in which a configuration needs a map from environment names to individually selected instance classes, with each value a string, use this action: Declare map(string) as the input type and select an entry by key, such as var.instance_class["staging"]. Maps encode named associations rather than numeric sequence positions. Verify: The selected environment returns the class value under the requested map key. Limitation: A missing map key causes an expression error unless a default is explicitly handled.
B:For the workstream in which an infrastructure release creates AWS resources in two regions, with a disaster-recovery instance explicitly assigned to the second region, use this action: Configure default and aliased AWS providers and assign the disaster-recovery resource to the alias. Multiple provider configurations allow one plugin to manage distinct endpoints or regions. Verify: The plan identifies primary and recovery resources using the intended regional provider instances. Limitation: Resources cannot infer an alias from a tag or name; it must be referenced by Terraform configuration.
Incorrect Answers
C:This option addresses a separate requirement: An operator leaves TF_LOG=TRACE enabled in production for all runs and sees excessive potentially sensitive logs. Evidence for that other requirement would be subsequent normal runs no longer emit verbose tracing to the same log destination; neither listed workstream asks for it.
D:This option addresses a separate requirement: A backend location was changed in configuration, but Terraform still recognizes the prior backend and asks how to proceed. Evidence for that other requirement would be the new backend holds the migrated state and a subsequent state list shows expected addresses; neither listed workstream asks for it.
E:This option addresses a separate requirement: An engineer wants a machine-readable view of the current Terraform state while building an inventory report. Evidence for that other requirement would be the JSON structure can be parsed for relevant addresses and outputs by authorized tooling; neither listed workstream asks for it.
Question 66
An infrastructure team faces this specific situation: A child network module expects two AWS provider aliases, but the root module has only passed its default provider. Which Terraform action most directly satisfies the requirement?
- Import the existing bucket into an appropriate resource address after writing matching configuration.
- Declare configuration_aliases in the child and pass the intended configurations through module.providers.
- Run terraform init -upgrade after reviewing the intended provider compatibility change.
- Distinguish provider-version lock metadata from terraform.tfstate and protect the actual state through suitable backend controls.
Explanation
Correct Answer
B:Declare configuration_aliases in the child and pass the intended configurations through module.providers. Provider maps and alias declarations make cross-module provider association explicit. Verify: The child resource plans with the specifically mapped source and destination provider aliases. Limitation: Aliased provider instances are not inherited automatically by a child module.
Incorrect Answers
A:This is linked to a different situation: A storage bucket exists in the cloud, but Terraform proposes creating another bucket with the intended name because its state has no binding. There the relevant decision is: Import the existing bucket into an appropriate resource address after writing matching configuration. For the question's actual requirement — A child network module expects two AWS provider aliases, but the root module has only passed its default provider. — the specifically relevant decision is: Declare configuration_aliases in the child and pass the intended configurations through module.providers. 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 — A child network module expects two AWS provider aliases, but the root module has only passed its default provider. — the specifically relevant decision is: Declare configuration_aliases in the child and pass the intended configurations through module.providers. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: A team considers keeping .terraform.lock.hcl in a secrets vault because it thinks the file is the primary infrastructure state store. There the relevant decision is: Distinguish provider-version lock metadata from terraform.tfstate and protect the actual state through suitable backend controls. For the question's actual requirement — A child network module expects two AWS provider aliases, but the root module has only passed its default provider. — the specifically relevant decision is: Declare configuration_aliases in the child and pass the intended configurations through module.providers. It would therefore not resolve or assess the case as stated.
Question 67
A reviewer is confirming a change for the following use case: A child network module expects two AWS provider aliases, but the root module has only passed its default provider. The implementation follows this approach: Declare configuration_aliases in the child and pass the intended configurations through module.providers. Which observation or acceptance test most directly verifies the intended result?
- The provider authenticates through the supported runtime identity without secrets appearing in committed configuration.
- The updated .terraform.lock.hcl records the newly selected compatible provider and its checksums.
- The child resource plans with the specifically mapped source and destination provider aliases.
- The lock entry identifies the intended registry namespace, provider type, and selected version.
Explanation
Correct Answer
C:Acceptance evidence: The child resource plans with the specifically mapped source and destination provider aliases. It validates the proposed action, declare configuration_aliases in the child and pass the intended configurations through module.providers, because provider maps and alias declarations make cross-module provider association explicit. Remaining limitation: Aliased provider instances are not inherited automatically by a child module.
Incorrect Answers
A: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 child network module expects two AWS provider aliases, but the root module has only passed its default provider. — the specifically relevant acceptance is: The child resource plans with the specifically mapped source and destination provider aliases. It would therefore not resolve or assess the case as stated.
B: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 acceptance is: The updated .terraform.lock.hcl records the newly selected compatible provider and its checksums. For the question's actual requirement — A child network module expects two AWS provider aliases, but the root module has only passed its default provider. — the specifically relevant acceptance is: The child resource plans with the specifically mapped source and destination provider aliases. 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 — A child network module expects two AWS provider aliases, but the root module has only passed its default provider. — the specifically relevant acceptance is: The child resource plans with the specifically mapped source and destination provider aliases. It would therefore not resolve or assess the case as stated.
Question 68
Consider a proposed solution for this requirement: A child network module expects two AWS provider aliases, but the root module has only passed its default provider. The team plans to do the following: Declare configuration_aliases in the child and pass the intended configurations through module.providers. Which limitation or operational caveat must remain in the review?
- The exact environment variable or identity mechanism is provider-specific and must be checked in its documentation.
- Aliased provider instances are not inherited automatically by a child module.
- Provider local names in HCL do not by themselves prove the external publisher namespace.
- The dependency lock file locks provider selections, not an immutable Terraform CLI binary version.
Explanation
Correct Answer
B:The limitation is aliased provider instances are not inherited automatically by a child module. The proposed change is declare configuration_aliases in the child and pass the intended configurations through module.providers. Validate it by checking the child resource plans with the specifically mapped source and destination provider aliases. Provider maps and alias declarations make cross-module provider association explicit.
Incorrect Answers
A: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 — A child network module expects two AWS provider aliases, but the root module has only passed its default provider. — the specifically relevant limitation is: Aliased provider instances are not inherited automatically by a child module. It would therefore not resolve or assess the case as stated.
C: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 limitation is: Provider local names in HCL do not by themselves prove the external publisher namespace. For the question's actual requirement — A child network module expects two AWS provider aliases, but the root module has only passed its default provider. — the specifically relevant limitation is: Aliased provider instances are not inherited automatically by a child module. It would therefore not resolve or assess the case as stated.
D: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 child network module expects two AWS provider aliases, but the root module has only passed its default provider. — the specifically relevant limitation is: Aliased provider instances are not inherited automatically by a child module. It would therefore not resolve or assess the case as stated.
Question 69
The team is reviewing a Terraform implementation for this case: A child network module expects two AWS provider aliases, but the root module has only passed its default provider. Which tempting assumption would be specifically incorrect for this proposed implementation?
- Edit a JSON state file by hand as the normal way to make an unmanaged bucket Terraform-managed.
- 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.
- Treat provider dependency checksums as the definitive list of deployed infrastructure resources.
Explanation
Correct Answer
B:Reject the assumption: Assume the child automatically inherits all aliases merely because it inherits an unaliased provider. Instead, declare configuration_aliases in the child and pass the intended configurations through module.providers. Provider maps and alias declarations make cross-module provider association explicit. Acceptance evidence: The child resource plans with the specifically mapped source and destination provider aliases.
Incorrect Answers
A:This is linked to a different situation: A storage bucket exists in the cloud, but Terraform proposes creating another bucket with the intended name because its state has no binding. There the relevant misconception is: Edit a JSON state file by hand as the normal way to make an unmanaged bucket Terraform-managed. For the question's actual requirement — A child network module expects two AWS provider aliases, but the root module has only passed its default provider. — the specifically relevant misconception is: Assume the child automatically inherits all aliases merely because it inherits an unaliased provider. 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 child network module expects two AWS provider aliases, but the root module has only passed its default provider. — the specifically relevant misconception is: Assume the child automatically inherits all aliases merely because it inherits an unaliased provider. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: A team considers keeping .terraform.lock.hcl in a secrets vault because it thinks the file is the primary infrastructure state store. There the relevant misconception is: Treat provider dependency checksums as the definitive list of deployed infrastructure resources. For the question's actual requirement — A child network module expects two AWS provider aliases, but the root module has only passed its default provider. — the specifically relevant misconception is: Assume the child automatically inherits all aliases merely because it inherits an unaliased provider. It would therefore not resolve or assess the case as stated.
Question 70
A Terraform platform team is coordinating 3 independent decisions. Workstream A: A child network module expects two AWS provider aliases, but the root module has only passed its default provider. and Workstream B: An application team must create one DNS record per hostname from a stable set of known domain names. and Workstream C: A Terraform configuration contains both a cloud block and a backend block while planning to use HCP Terraform remote execution. Select exactly 3 actions, one addressing each distinct workstream.
- Use for_each over a suitable set or map to create stable keyed resource instances.
- Specify a reviewed registry-module version constraint in the module block.
- Declare configuration_aliases in the child and pass the intended configurations through module.providers.
- Use terraform show -json on the state or saved plan with proper access controls.
- Use terraform state show ADDRESS or a carefully scoped terraform show output on the selected state.
- Select the appropriate HCP Terraform cloud integration and remove the conflicting backend declaration.
Explanation
Correct Answers
A:For the workstream in which an application team must create one DNS record per hostname from a stable set of known domain names, use this action: Use for_each over a suitable set or map to create stable keyed resource instances. for_each is useful when each instance has a stable logical key. Verify: A change to one hostname affects its keyed address instead of renumbering unrelated instances. Limitation: Removing or renaming a key can still destroy or replace that keyed resource instance.
C:For the workstream in which a child network module expects two AWS provider aliases, but the root module has only passed its default provider, use this action: Declare configuration_aliases in the child and pass the intended configurations through module.providers. Provider maps and alias declarations make cross-module provider association explicit. Verify: The child resource plans with the specifically mapped source and destination provider aliases. Limitation: Aliased provider instances are not inherited automatically by a child module.
F: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.
Incorrect Answers
B:This action is appropriate instead for a different, unlisted requirement: A team uses a module from the public registry and needs to prevent unreviewed minor changes after a security assessment. It would be checked by: Initialization selects a module release satisfying the stated registry version requirement. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.
D:This action is appropriate instead for a different, unlisted requirement: 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.
E: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.
HashiCorp Certified: Terraform Associate (004) (Terraform Associate 004) Practice Tests