HashiCorp Terraform Associate (HashiCorp Certified: Terraform Associate) Practice Test 71

Question 700

A support engineer needs deeper diagnostics temporarily. The checklist contains independent tasks: (1) focus diagnostic verbosity on Terraform Core behavior; (2) return routine automation to normal logging behavior. Which two options directly correspond to the respective tasks? Choose TWO.

  1. Check provider authentication separately from HCL syntax
  2. Set TF_LOG=ERROR for critical diagnostics
  3. Set TF_LOG=WARN to reduce detail
  4. Set TF_LOG_CORE selectively
  5. Unset TF_LOG after diagnosing the issue

Explanation

Correct Answers

D:

Core logging helps with evaluation, graph, and orchestration investigation; provider-specific API problems may need provider logging instead; this behavior should be assessed against the concrete need to focus diagnostic verbosity on Terraform Core behavior and return routine automation to normal logging behavior. This matches the distinct objective to focus diagnostic verbosity on Terraform Core behavior; the remaining chosen features address return routine automation to normal logging behavior.

E:

Leaving TRACE or DEBUG enabled increases noise and secret-exposure risk; temporary troubleshooting settings should not remain in all pipeline runs; this behavior should be assessed against the concrete need to focus diagnostic verbosity on Terraform Core behavior and return routine automation to normal logging behavior. This matches the distinct objective to return routine automation to normal logging behavior; the remaining chosen features address focus diagnostic verbosity on Terraform Core behavior.

Incorrect Answers

A:

Verbose provider diagnostics can identify API permission failures; a successful terraform validate cannot prove remote credentials have the required rights; this behavior should be assessed against the concrete need to focus diagnostic verbosity on Terraform Core behavior and return routine automation to normal logging behavior. Its main application is to distinguish runtime access problems from configuration parse errors; the checklist instead asks for focus diagnostic verbosity on Terraform Core behavior; and return routine automation to normal logging behavior. None of those distinct criteria specifically calls for this alternative.

B:

The error level minimizes routine diagnostic output; it is unsuitable when the root cause only appears in earlier debug events; this behavior should be assessed against the concrete need to focus diagnostic verbosity on Terraform Core behavior and return routine automation to normal logging behavior. Its main application is to restrict log output primarily to errors; the checklist instead asks for focus diagnostic verbosity on Terraform Core behavior; and return routine automation to normal logging behavior. None of those distinct criteria specifically calls for this alternative.

C:

Warning-level logs are useful when normal runs are noisy; they may omit the detailed plugin exchange needed for complex failures; this behavior should be assessed against the concrete need to focus diagnostic verbosity on Terraform Core behavior and return routine automation to normal logging behavior. Its main application is to focus on warnings and errors rather than full execution traces; the checklist instead asks for focus diagnostic verbosity on Terraform Core behavior; and return routine automation to normal logging behavior. None of those distinct criteria specifically calls for this alternative.

Question 701

A resource already exists outside Terraform management. The team must both attach an existing remote object to a specific declared resource address and record an import intent as version-controlled configuration. Which paired choice implements those distinct goals?

  1. Use indexed resource addresses for repeated resources + Use a declarative import { to = ..., id = ... } block
  2. Use terraform import ADDRESS ID for CLI import + Use a declarative import { to = ..., id = ... } block
  3. Identify the correct provider-specific import ID + Use a declarative import { to = ..., id = ... } block
  4. Use terraform import ADDRESS ID for CLI import + Use terraform plan -generate-config-out=FILE for supported imports
  5. Use terraform import ADDRESS ID for CLI import + Write a matching resource block before normal management
  6. Avoid importing the same object under unrelated addresses + Select the correct resource type for import

Explanation

Correct Answer

B:

For the first criterion, the command associates the provider's remote identifier with an address in state; valid resource configuration is still needed for ongoing safe management; this behavior should be assessed against the concrete need to attach an existing remote object to a specific declared resource address and record an import intent as version-controlled configuration; this directly addresses the need to attach an existing remote object to a specific declared resource address. For the separate second criterion, an import block tells Terraform to associate a remote object with a resource address during planning and applying; it improves auditability over an undocumented one-off CLI command; this behavior should be assessed against the concrete need to attach an existing remote object to a specific declared resource address and record an import intent as version-controlled configuration; this fulfills the need to record an import intent as version-controlled configuration. Together they cover the independent tasks of attach an existing remote object to a specific declared resource address and record an import intent as version-controlled configuration without exchanging the responsibilities of these features.

Incorrect Answers

A:

The second measure does meet the record an import intent as version-controlled configuration requirement, but the first is designed for another concern: An address such as resource.name[0] or ["key"] selects one instance; omitting the index can refer to the wrong declaration shape; this behavior should be assessed against the concrete need to attach an existing remote object to a specific declared resource address and record an import intent as version-controlled configuration. That first component is designed to target the appropriate count or for-each instance during import, which does not accomplish the requested task to attach an existing remote object to a specific declared resource address, even though the other measure satisfies record an import intent as version-controlled configuration.

C:

The second measure does meet the record an import intent as version-controlled configuration requirement, but the first is designed for another concern: Providers define acceptable import IDs and formats; an incorrect ID can fail import or target an unintended existing object; this behavior should be assessed against the concrete need to attach an existing remote object to a specific declared resource address and record an import intent as version-controlled configuration. That first component is designed to avoid mapping an address to the wrong remote infrastructure object, which does not accomplish the requested task to attach an existing remote object to a specific declared resource address, even though the other measure satisfies record an import intent as version-controlled configuration.

D:

The first measure meets the requirement to attach an existing remote object to a specific declared resource address, but its partner serves a different role: Configuration generation assists authoring but needs review for defaults, computed fields, and organization policy; generated text is not guaranteed production-ready; this behavior should be assessed against the concrete need to attach an existing remote object to a specific declared resource address and record an import intent as version-controlled configuration. That second component is designed to help draft resource configuration from import intent, so the still-missing criterion is to record an import intent as version-controlled configuration, while the first criterion remains attach an existing remote object to a specific declared resource address.

E:

The first measure meets the requirement to attach an existing remote object to a specific declared resource address, but its partner serves a different role: Import establishes identity, but a later plan compares the real object with declared arguments; mismatches can cause unexpected changes or replacements; this behavior should be assessed against the concrete need to attach an existing remote object to a specific declared resource address and record an import intent as version-controlled configuration. That second component is designed to describe the adopted object's intended configuration in HCL, so the still-missing criterion is to record an import intent as version-controlled configuration, while the first criterion remains attach an existing remote object to a specific declared resource address.

F:

The first measure is intended to prevent two Terraform resources or states from claiming one remote object: Terraform assumes one managed binding for a remote object; duplicate ownership can lead to conflicting updates and deletions; this behavior should be assessed against the concrete need to attach an existing remote object to a specific declared resource address and record an import intent as version-controlled configuration. The second measure is intended to use a provider schema that matches the remote object's API kind: Import requires a compatible Terraform resource type; a read-only data source is not a managed-resource import target; this behavior should be assessed against the concrete need to attach an existing remote object to a specific declared resource address and record an import intent as version-controlled configuration. Neither is the directly designated method for the separate goals of attach an existing remote object to a specific declared resource address and record an import intent as version-controlled configuration in this review.

Question 702

A maintenance task requires reviewing one tracked object. The requirement is to obtain machine-readable saved state or plan data through a documented command. Which Terraform mechanism directly meets this requirement?

  1. Run terraform state replace-provider OLD NEW
  2. Use terraform show -json for structured state inspection
  3. Run terraform state pull
  4. Run terraform state show ADDRESS

Explanation

Correct Answer

B:

JSON can support controlled analysis, but it may expose sensitive values; it is different from using arbitrary text parsing of human output; this behavior should be assessed against the concrete need to obtain machine-readable saved state or plan data through a documented command. This directly supports the task to obtain machine-readable saved state or plan data through a documented command during an automated release.

Incorrect Answers

A:

This advanced operation updates provider references for tracked objects; it does not automatically guarantee schemas or new plugin behavior are compatible; this behavior should be assessed against the concrete need to obtain machine-readable saved state or plan data through a documented command. The distinction matters here: using that mechanism to rewrite provider source associations in state during provider migration would still leave the objective to obtain machine-readable saved state or plan data through a documented command unmet.

C:

Pull writes the JSON state to standard output for protected inspection; its contents may include credentials and sensitive resource values; this behavior should be assessed against the concrete need to obtain machine-readable saved state or plan data through a documented command. The stated requirement is to obtain machine-readable saved state or plan data through a documented command, not to obtain the current state snapshot from the configured backend; this alternative addresses a different control or phase.

D:

Show exposes attributes and remote IDs from state; a current refresh may be needed to learn if the real object changed; this behavior should be assessed against the concrete need to obtain machine-readable saved state or plan data through a documented command. That can be useful when the aim is to inspect recorded attributes for one managed resource instance, but it does not directly deliver the requested ability to obtain machine-readable saved state or plan data through a documented command.

Question 703

During a deployment checklist, one task is to focus logging on provider/plugin interactions, while another is to limit disclosure of tokens, resource properties, and environment details. Select the matching pair of techniques.

  1. Set TF_LOG_PROVIDER selectively + Set TF_LOG_CORE selectively
  2. Reproduce with a fresh plan when investigating drift + Set TF_LOG=ERROR for critical diagnostics
  3. Set TF_LOG_PROVIDER selectively + Avoid uploading full trace logs without redaction
  4. Check provider authentication separately from HCL syntax + Avoid uploading full trace logs without redaction

Explanation

Correct Answer

C:

For the first criterion, provider logs help diagnose plugin and remote API behavior; they should be protected because request details may expose sensitive fields; this behavior should be assessed against the concrete need to focus logging on provider/plugin interactions and limit disclosure of tokens, resource properties, and environment details; this directly addresses the need to focus logging on provider/plugin interactions. For the separate second criterion, verbose diagnostics can reveal credential material or identifiers; sanitization is necessary before sharing with external support; this behavior should be assessed against the concrete need to focus logging on provider/plugin interactions and limit disclosure of tokens, resource properties, and environment details; this fulfills the need to limit disclosure of tokens, resource properties, and environment details. Together they cover the independent tasks of focus logging on provider/plugin interactions and limit disclosure of tokens, resource properties, and environment details without exchanging the responsibilities of these features.

Incorrect Answers

A:

The first measure meets the requirement to focus logging on provider/plugin interactions, but its partner serves a different role: Core logging helps with evaluation, graph, and orchestration investigation; provider-specific API problems may need provider logging instead; this behavior should be assessed against the concrete need to focus logging on provider/plugin interactions and limit disclosure of tokens, resource properties, and environment details. That second component is designed to focus diagnostic verbosity on Terraform Core behavior, so the still-missing criterion is to limit disclosure of tokens, resource properties, and environment details, while the first criterion remains focus logging on provider/plugin interactions.

B:

The first measure is intended to distinguish unexpected provider reads from the planned change graph: A plan helps reveal resource actions while logging illuminates execution details; neither should be used as an excuse to modify state blindly; this behavior should be assessed against the concrete need to focus logging on provider/plugin interactions and limit disclosure of tokens, resource properties, and environment details. The second measure is intended to restrict log output primarily to errors: The error level minimizes routine diagnostic output; it is unsuitable when the root cause only appears in earlier debug events; this behavior should be assessed against the concrete need to focus logging on provider/plugin interactions and limit disclosure of tokens, resource properties, and environment details. Neither is the directly designated method for the separate goals of focus logging on provider/plugin interactions and limit disclosure of tokens, resource properties, and environment details in this review.

D:

The second measure does meet the limit disclosure of tokens, resource properties, and environment details requirement, but the first is designed for another concern: Verbose provider diagnostics can identify API permission failures; a successful terraform validate cannot prove remote credentials have the required rights; this behavior should be assessed against the concrete need to focus logging on provider/plugin interactions and limit disclosure of tokens, resource properties, and environment details. That first component is designed to distinguish runtime access problems from configuration parse errors, which does not accomplish the requested task to focus logging on provider/plugin interactions, even though the other measure satisfies limit disclosure of tokens, resource properties, and environment details.

Question 704

An engineer is onboarding a legacy service into IaC. The requirement is to attach an existing remote object to a specific declared resource address. Which Terraform mechanism directly meets this requirement?

  1. Use terraform import ADDRESS ID for CLI import
  2. Review the first post-import plan
  3. Use indexed resource addresses for repeated resources
  4. Use a declarative import { to = ..., id = ... } block
  5. Select the correct resource type for import

Explanation

Correct Answer

A:

The command associates the provider's remote identifier with an address in state; valid resource configuration is still needed for ongoing safe management; this behavior should be assessed against the concrete need to attach an existing remote object to a specific declared resource address. This directly supports the task to attach an existing remote object to a specific declared resource address during an automated release.

Incorrect Answers

B:

The first plan can expose fields that require deliberate configuration; importing does not promise a no-op next plan; this behavior should be assessed against the concrete need to attach an existing remote object to a specific declared resource address. That can be useful when the aim is to detect discrepancies between adopted object settings and desired HCL, but it does not directly deliver the requested ability to attach an existing remote object to a specific declared resource address.

C:

An address such as resource.name[0] or ["key"] selects one instance; omitting the index can refer to the wrong declaration shape; this behavior should be assessed against the concrete need to attach an existing remote object to a specific declared resource address. The distinction matters here: using that mechanism to target the appropriate count or for-each instance during import would still leave the objective to attach an existing remote object to a specific declared resource address unmet.

D:

An import block tells Terraform to associate a remote object with a resource address during planning and applying; it improves auditability over an undocumented one-off CLI command; this behavior should be assessed against the concrete need to attach an existing remote object to a specific declared resource address. It may support a related workflow, but the question specifically requires the mechanism for attach an existing remote object to a specific declared resource address rather than record an import intent as version-controlled configuration.

E:

Import requires a compatible Terraform resource type; a read-only data source is not a managed-resource import target; this behavior should be assessed against the concrete need to attach an existing remote object to a specific declared resource address. The stated requirement is to attach an existing remote object to a specific declared resource address, not to use a provider schema that matches the remote object's API kind; this alternative addresses a different control or phase.

Question 705

An engineer is distinguishing read-only state inspection from mutation. A reviewer must determine how to avoid pasting raw state into tickets or public CI logs. Which action is the appropriate choice?

  1. Avoid treating state show as a live inventory command
  2. Recognize state subcommands operate against remote backends
  3. Protect state output containing sensitive fields
  4. Inspect a module path in state list

Explanation

Correct Answer

C:

Read-only inspection does not sanitize secrets; use restricted environments and redact debugging excerpts before sharing; this behavior should be assessed against the concrete need to avoid pasting raw state into tickets or public CI logs. This directly supports the task to avoid pasting raw state into tickets or public CI logs during a staged rollout.

Incorrect Answers

A:

The output is a snapshot of Terraform's knowledge; to evaluate current remote changes, run a normal plan or appropriate refresh workflow; this behavior should be assessed against the concrete need to avoid pasting raw state into tickets or public CI logs. It may support a related workflow, but the question specifically requires the mechanism for avoid pasting raw state into tickets or public CI logs rather than remember it reads recorded state attributes rather than querying all objects.

B:

State reads and writes may perform network requests for remote snapshots; write operations still require appropriate permissions and locking; this behavior should be assessed against the concrete need to avoid pasting raw state into tickets or public CI logs. The stated requirement is to avoid pasting raw state into tickets or public CI logs, not to use the configured backend rather than assuming every state operation is local; this alternative addresses a different control or phase.

D:

Addresses contain module. segments and possibly instance keys; the path shows Terraform's configuration structure, not the cloud resource's human label; this behavior should be assessed against the concrete need to avoid pasting raw state into tickets or public CI logs. The distinction matters here: using that mechanism to locate resources managed inside a nested module would still leave the objective to avoid pasting raw state into tickets or public CI logs unmet.

Question 706

A reviewer has to approve a two-part design: collect detailed execution information without the highest trace verbosity; additionally, focus diagnostic verbosity on Terraform Core behavior. Which option pairs the correct mechanisms?

  1. Set TF_LOG=ERROR for critical diagnostics + Set TF_LOG_CORE selectively
  2. Set TF_LOG=WARN to reduce detail + Set TF_LOG=TRACE for deep diagnostics
  3. Set TF_LOG=DEBUG for debugging + Set TF_LOG_CORE selectively
  4. Set TF_LOG=DEBUG for debugging + Check provider authentication separately from HCL syntax

Explanation

Correct Answer

C:

For the first criterion, debug messages help investigate evaluation and plugin issues; they still require safe retention and redaction; this behavior should be assessed against the concrete need to collect detailed execution information without the highest trace verbosity and focus diagnostic verbosity on Terraform Core behavior; this directly addresses the need to collect detailed execution information without the highest trace verbosity. For the separate second criterion, core logging helps with evaluation, graph, and orchestration investigation; provider-specific API problems may need provider logging instead; this behavior should be assessed against the concrete need to collect detailed execution information without the highest trace verbosity and focus diagnostic verbosity on Terraform Core behavior; this fulfills the need to focus diagnostic verbosity on Terraform Core behavior. Together they cover the independent tasks of collect detailed execution information without the highest trace verbosity and focus diagnostic verbosity on Terraform Core behavior without exchanging the responsibilities of these features.

Incorrect Answers

A:

The second measure does meet the focus diagnostic verbosity on Terraform Core behavior requirement, but the first is designed for another concern: The error level minimizes routine diagnostic output; it is unsuitable when the root cause only appears in earlier debug events; this behavior should be assessed against the concrete need to collect detailed execution information without the highest trace verbosity and focus diagnostic verbosity on Terraform Core behavior. That first component is designed to restrict log output primarily to errors, which does not accomplish the requested task to collect detailed execution information without the highest trace verbosity, even though the other measure satisfies focus diagnostic verbosity on Terraform Core behavior.

B:

The first measure is intended to focus on warnings and errors rather than full execution traces: Warning-level logs are useful when normal runs are noisy; they may omit the detailed plugin exchange needed for complex failures; this behavior should be assessed against the concrete need to collect detailed execution information without the highest trace verbosity and focus diagnostic verbosity on Terraform Core behavior. The second measure is intended to enable the most detailed general Terraform diagnostic messages: Trace logging can reveal Core and provider interactions; it may include sensitive data and should be enabled only for controlled troubleshooting; this behavior should be assessed against the concrete need to collect detailed execution information without the highest trace verbosity and focus diagnostic verbosity on Terraform Core behavior. Neither is the directly designated method for the separate goals of collect detailed execution information without the highest trace verbosity and focus diagnostic verbosity on Terraform Core behavior in this review.

D:

The first measure meets the requirement to collect detailed execution information without the highest trace verbosity, but its partner serves a different role: Verbose provider diagnostics can identify API permission failures; a successful terraform validate cannot prove remote credentials have the required rights; this behavior should be assessed against the concrete need to collect detailed execution information without the highest trace verbosity and focus diagnostic verbosity on Terraform Core behavior. That second component is designed to distinguish runtime access problems from configuration parse errors, so the still-missing criterion is to focus diagnostic verbosity on Terraform Core behavior, while the first criterion remains collect detailed execution information without the highest trace verbosity.

Question 707

During a deployment checklist, one task is to avoid mapping an address to the wrong remote infrastructure object, while another is to detect discrepancies between adopted object settings and desired HCL. Select the matching pair of techniques.

  1. Identify the correct provider-specific import ID + Use a declarative import { to = ..., id = ... } block
  2. Avoid importing the same object under unrelated addresses + Use indexed resource addresses for repeated resources
  3. Identify the correct provider-specific import ID + Review the first post-import plan
  4. Protect state and take backups before bulk import + Review the first post-import plan
  5. Select the correct resource type for import + Review the first post-import plan

Explanation

Correct Answer

C:

For the first criterion, providers define acceptable import IDs and formats; an incorrect ID can fail import or target an unintended existing object; this behavior should be assessed against the concrete need to avoid mapping an address to the wrong remote infrastructure object and detect discrepancies between adopted object settings and desired HCL; this directly addresses the need to avoid mapping an address to the wrong remote infrastructure object. For the separate second criterion, the first plan can expose fields that require deliberate configuration; importing does not promise a no-op next plan; this behavior should be assessed against the concrete need to avoid mapping an address to the wrong remote infrastructure object and detect discrepancies between adopted object settings and desired HCL; this fulfills the need to detect discrepancies between adopted object settings and desired HCL. Together they cover the independent tasks of avoid mapping an address to the wrong remote infrastructure object and detect discrepancies between adopted object settings and desired HCL without exchanging the responsibilities of these features.

Incorrect Answers

A:

The first measure meets the requirement to avoid mapping an address to the wrong remote infrastructure object, but its partner serves a different role: An import block tells Terraform to associate a remote object with a resource address during planning and applying; it improves auditability over an undocumented one-off CLI command; this behavior should be assessed against the concrete need to avoid mapping an address to the wrong remote infrastructure object and detect discrepancies between adopted object settings and desired HCL. That second component is designed to record an import intent as version-controlled configuration, so the still-missing criterion is to detect discrepancies between adopted object settings and desired HCL, while the first criterion remains avoid mapping an address to the wrong remote infrastructure object.

B:

The first measure is intended to prevent two Terraform resources or states from claiming one remote object: Terraform assumes one managed binding for a remote object; duplicate ownership can lead to conflicting updates and deletions; this behavior should be assessed against the concrete need to avoid mapping an address to the wrong remote infrastructure object and detect discrepancies between adopted object settings and desired HCL. The second measure is intended to target the appropriate count or for-each instance during import: An address such as resource.name[0] or ["key"] selects one instance; omitting the index can refer to the wrong declaration shape; this behavior should be assessed against the concrete need to avoid mapping an address to the wrong remote infrastructure object and detect discrepancies between adopted object settings and desired HCL. Neither is the directly designated method for the separate goals of avoid mapping an address to the wrong remote infrastructure object and detect discrepancies between adopted object settings and desired HCL in this review.

D:

The second measure does meet the detect discrepancies between adopted object settings and desired HCL requirement, but the first is designed for another concern: Import modifies Terraform's view of which resources it controls; a wrong mapping can affect later apply and destroy operations; this behavior should be assessed against the concrete need to avoid mapping an address to the wrong remote infrastructure object and detect discrepancies between adopted object settings and desired HCL. That first component is designed to mitigate risk while modifying ownership mappings, which does not accomplish the requested task to avoid mapping an address to the wrong remote infrastructure object, even though the other measure satisfies detect discrepancies between adopted object settings and desired HCL.

E:

The second measure does meet the detect discrepancies between adopted object settings and desired HCL requirement, but the first is designed for another concern: Import requires a compatible Terraform resource type; a read-only data source is not a managed-resource import target; this behavior should be assessed against the concrete need to avoid mapping an address to the wrong remote infrastructure object and detect discrepancies between adopted object settings and desired HCL. That first component is designed to use a provider schema that matches the remote object's API kind, which does not accomplish the requested task to avoid mapping an address to the wrong remote infrastructure object, even though the other measure satisfies detect discrepancies between adopted object settings and desired HCL.

Question 708

During a deployment checklist, the team must accomplish all of these distinct aims: (1) remove a tracked binding without calling the provider's delete operation; (2) use the configured backend rather than assuming every state operation is local. Select exactly the two relevant mechanisms. Choose TWO.

  1. Protect state output containing sensitive fields
  2. Use terraform show -json for structured state inspection
  3. Recognize state subcommands operate against remote backends
  4. Run terraform state list
  5. Run terraform state rm ADDRESS

Explanation

Correct Answers

C:

State reads and writes may perform network requests for remote snapshots; write operations still require appropriate permissions and locking; this behavior should be assessed against the concrete need to remove a tracked binding without calling the provider's delete operation and use the configured backend rather than assuming every state operation is local. This matches the distinct objective to use the configured backend rather than assuming every state operation is local; the remaining chosen features address remove a tracked binding without calling the provider's delete operation.

E:

State removal forgets an object; it is not terraform destroy; leaving the same declaration in HCL may lead to new creation proposals; this behavior should be assessed against the concrete need to remove a tracked binding without calling the provider's delete operation and use the configured backend rather than assuming every state operation is local. This matches the distinct objective to remove a tracked binding without calling the provider's delete operation; the remaining chosen features address use the configured backend rather than assuming every state operation is local.

Incorrect Answers

A:

Read-only inspection does not sanitize secrets; use restricted environments and redact debugging excerpts before sharing; this behavior should be assessed against the concrete need to remove a tracked binding without calling the provider's delete operation and use the configured backend rather than assuming every state operation is local. Its main application is to avoid pasting raw state into tickets or public CI logs; the checklist instead asks for remove a tracked binding without calling the provider's delete operation; and use the configured backend rather than assuming every state operation is local. None of those distinct criteria specifically calls for this alternative.

B:

JSON can support controlled analysis, but it may expose sensitive values; it is different from using arbitrary text parsing of human output; this behavior should be assessed against the concrete need to remove a tracked binding without calling the provider's delete operation and use the configured backend rather than assuming every state operation is local. Its main application is to obtain machine-readable saved state or plan data through a documented command; the checklist instead asks for remove a tracked binding without calling the provider's delete operation; and use the configured backend rather than assuming every state operation is local. None of those distinct criteria specifically calls for this alternative.

D:

The command lists tracked instances and module paths; it does not discover resources existing outside Terraform management; this behavior should be assessed against the concrete need to remove a tracked binding without calling the provider's delete operation and use the configured backend rather than assuming every state operation is local. Its main application is to enumerate all resource addresses currently bound in state; the checklist instead asks for remove a tracked binding without calling the provider's delete operation; and use the configured backend rather than assuming every state operation is local. None of those distinct criteria specifically calls for this alternative.

Question 709

In an automated release, the requested result is to restrict log output primarily to errors. What should the engineer select?

  1. Unset TF_LOG after diagnosing the issue
  2. Set TF_LOG_PROVIDER selectively
  3. Set TF_LOG=ERROR for critical diagnostics
  4. Set TF_LOG=DEBUG for debugging

Explanation

Correct Answer

C:

The error level minimizes routine diagnostic output; it is unsuitable when the root cause only appears in earlier debug events; this behavior should be assessed against the concrete need to restrict log output primarily to errors. This directly supports the task to restrict log output primarily to errors during a module implementation.

Incorrect Answers

A:

Leaving TRACE or DEBUG enabled increases noise and secret-exposure risk; temporary troubleshooting settings should not remain in all pipeline runs; this behavior should be assessed against the concrete need to restrict log output primarily to errors. It may support a related workflow, but the question specifically requires the mechanism for restrict log output primarily to errors rather than return routine automation to normal logging behavior.

B:

Provider logs help diagnose plugin and remote API behavior; they should be protected because request details may expose sensitive fields; this behavior should be assessed against the concrete need to restrict log output primarily to errors. The stated requirement is to restrict log output primarily to errors, not to focus logging on provider/plugin interactions; this alternative addresses a different control or phase.

D:

Debug messages help investigate evaluation and plugin issues; they still require safe retention and redaction; this behavior should be assessed against the concrete need to restrict log output primarily to errors. The distinction matters here: using that mechanism to collect detailed execution information without the highest trace verbosity would still leave the objective to restrict log output primarily to errors unmet.

Question 710

During a deployment checklist, the team must accomplish all of these distinct aims: (1) adopt an object into a child module's declared resource; (2) map a collection of existing IDs to multiple resource instances. Select exactly the two relevant mechanisms. Choose TWO.

  1. Use import blocks with for_each when supported
  2. Use module-qualified import addresses
  3. Use indexed resource addresses for repeated resources
  4. Use terraform plan -generate-config-out=FILE for supported imports
  5. Identify the correct provider-specific import ID
  6. Review the first post-import plan

Explanation

Correct Answers

A:

Configuration-driven import can iterate known instances; each generated target still must correspond to a managed resource declaration; this behavior should be assessed against the concrete need to adopt an object into a child module's declared resource and map a collection of existing IDs to multiple resource instances. This matches the distinct objective to map a collection of existing IDs to multiple resource instances; the remaining chosen features address adopt an object into a child module's declared resource.

B:

Resource addresses can include paths such as module.network.aws_vpc.main; correct addresses preserve the intended module ownership; this behavior should be assessed against the concrete need to adopt an object into a child module's declared resource and map a collection of existing IDs to multiple resource instances. This matches the distinct objective to adopt an object into a child module's declared resource; the remaining chosen features address map a collection of existing IDs to multiple resource instances.

Incorrect Answers

C:

An address such as resource.name[0] or ["key"] selects one instance; omitting the index can refer to the wrong declaration shape; this behavior should be assessed against the concrete need to adopt an object into a child module's declared resource and map a collection of existing IDs to multiple resource instances. Its main application is to target the appropriate count or for-each instance during import; the checklist instead asks for adopt an object into a child module's declared resource; and map a collection of existing IDs to multiple resource instances. None of those distinct criteria specifically calls for this alternative.

D:

Configuration generation assists authoring but needs review for defaults, computed fields, and organization policy; generated text is not guaranteed production-ready; this behavior should be assessed against the concrete need to adopt an object into a child module's declared resource and map a collection of existing IDs to multiple resource instances. Its main application is to help draft resource configuration from import intent; the checklist instead asks for adopt an object into a child module's declared resource; and map a collection of existing IDs to multiple resource instances. None of those distinct criteria specifically calls for this alternative.

E:

Providers define acceptable import IDs and formats; an incorrect ID can fail import or target an unintended existing object; this behavior should be assessed against the concrete need to adopt an object into a child module's declared resource and map a collection of existing IDs to multiple resource instances. Its main application is to avoid mapping an address to the wrong remote infrastructure object; the checklist instead asks for adopt an object into a child module's declared resource; and map a collection of existing IDs to multiple resource instances. None of those distinct criteria specifically calls for this alternative.

F:

The first plan can expose fields that require deliberate configuration; importing does not promise a no-op next plan; this behavior should be assessed against the concrete need to adopt an object into a child module's declared resource and map a collection of existing IDs to multiple resource instances. Its main application is to detect discrepancies between adopted object settings and desired HCL; the checklist instead asks for adopt an object into a child module's declared resource; and map a collection of existing IDs to multiple resource instances. None of those distinct criteria specifically calls for this alternative.

HashiCorp Certified: Terraform Associate (Terraform Associate) Practice Tests