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

Question 120

A Terraform rollout has separate acceptance criteria: distinguish a local provider name from its registry namespace and avoid assuming ordinary resource arguments hide secrets from state. Which combined approach directly satisfies the two criteria?

  1. Recognize provider source addresses + Recognize a provider as an API plugin
  2. Select a provider using the resource type prefix + Review provider documentation for sensitive attributes
  3. Recognize provider source addresses + Review provider documentation for sensitive attributes
  4. Configure a provider's authentication + Understand a provider plugin's version independence

Explanation

Correct Answer

C:

For the first criterion, the source includes registry host, namespace, and type when fully qualified; local names let modules refer to that provider without repeating its entire address; this behavior should be assessed against the concrete need to distinguish a local provider name from its registry namespace and avoid assuming ordinary resource arguments hide secrets from state; this directly addresses the need to distinguish a local provider name from its registry namespace. For the separate second criterion, providers decide which schema values are stored, sensitive in display, or write-only; hiding a value in output is not equivalent to omitting it from state; this behavior should be assessed against the concrete need to distinguish a local provider name from its registry namespace and avoid assuming ordinary resource arguments hide secrets from state; this fulfills the need to avoid assuming ordinary resource arguments hide secrets from state. Together they cover the independent tasks of distinguish a local provider name from its registry namespace and avoid assuming ordinary resource arguments hide secrets from state without exchanging the responsibilities of these features.

Incorrect Answers

A:

The first measure meets the requirement to distinguish a local provider name from its registry namespace, but its partner serves a different role: Provider binaries translate resource and data-source lifecycle requests into service-specific API calls; terraform Core builds plans and tracks dependencies, rather than implementing every cloud API directly; this behavior should be assessed against the concrete need to distinguish a local provider name from its registry namespace and avoid assuming ordinary resource arguments hide secrets from state. That second component is designed to map Terraform resource operations to a platform's API, so the still-missing criterion is to avoid assuming ordinary resource arguments hide secrets from state, while the first criterion remains distinguish a local provider name from its registry namespace.

B:

The second measure does meet the avoid assuming ordinary resource arguments hide secrets from state requirement, but the first is designed for another concern: A type such as aws_instance typically maps to the default local provider name aws; an explicit provider meta-argument can override that default configuration; this behavior should be assessed against the concrete need to distinguish a local provider name from its registry namespace and avoid assuming ordinary resource arguments hide secrets from state. That first component is designed to understand how an unqualified resource chooses its default provider, which does not accomplish the requested task to distinguish a local provider name from its registry namespace, even though the other measure satisfies avoid assuming ordinary resource arguments hide secrets from state.

D:

The first measure is intended to supply credentials and settings needed for remote API requests: Provider configuration determines how the plugin connects to its service; defining the plugin requirement alone is not sufficient for authenticated resource operations; this behavior should be assessed against the concrete need to distinguish a local provider name from its registry namespace and avoid assuming ordinary resource arguments hide secrets from state. The second measure is intended to separate provider release changes from upgrading Terraform CLI: A provider is distributed and versioned independently of Terraform Core; compatibility constraints may restrict usable combinations; this behavior should be assessed against the concrete need to distinguish a local provider name from its registry namespace and avoid assuming ordinary resource arguments hide secrets from state. Neither is the directly designated method for the separate goals of distinguish a local provider name from its registry namespace and avoid assuming ordinary resource arguments hide secrets from state in this review.

Question 121

An engineer needs to support a module that must address source and destination environments as part of an automated release. Which option is the best fit?

  1. Bind a data source to the appropriate provider alias
  2. Declare required_providers separately in a child module
  3. Understand the implied empty default provider configuration
  4. Map multiple aliases for a cross-region child module

Explanation

Correct Answer

D:

A child can declare distinct alias names and the caller can bind each one to a separate root configuration; passing a single default is insufficient for a two-context design; this behavior should be assessed against the concrete need to support a module that must address source and destination environments. This directly supports the task to support a module that must address source and destination environments during an infrastructure audit.

Incorrect Answers

A:

Data sources accept provider selection as managed resources do; a lookup against the wrong default configuration may return the wrong object or no object; this behavior should be assessed against the concrete need to support a module that must address source and destination environments. The distinction matters here: using that mechanism to ensure reads occur in the intended service account or region would still leave the objective to support a module that must address source and destination environments unmet.

B:

Provider configurations may be passed across modules, but source and version requirements are local to each module; explicit requirements prevent incorrect provider-source inference; this behavior should be assessed against the concrete need to support a module that must address source and destination environments. It may support a related workflow, but the question specifically requires the mechanism for support a module that must address source and destination environments rather than document the plugin source and compatibility constraints inside each module.

C:

If all provider blocks use aliases, resources without an explicit provider may fall back to an implied empty default; required settings then may be missing; this behavior should be assessed against the concrete need to support a module that must address source and destination environments. The stated requirement is to support a module that must address source and destination environments, not to diagnose failures when only aliases are configured; this alternative addresses a different control or phase.

Question 122

A developer is comparing configuration, state, and current infrastructure. Two independent changes are requested: first, identify which remote object Terraform currently manages for a resource block; second, compare tracked objects against current provider-reported attributes. Which pair of measures fulfills both?

  1. Treat state as the resource-address-to-object mapping + Avoid manual state-file editing
  2. Treat state as the resource-address-to-object mapping + Understand refresh during planning
  3. Treat state snapshots as recoverable but hazardous + Understand refresh during planning
  4. Use a remote backend for shared state + Distinguish a managed object from a data-source read

Explanation

Correct Answer

B:

For the first criterion, state binds addresses in configuration to provider-specific remote IDs and recorded attributes; without that mapping Terraform cannot reliably correlate every declared block with an existing object; this behavior should be assessed against the concrete need to identify which remote object Terraform currently manages for a resource block and compare tracked objects against current provider-reported attributes; this directly addresses the need to identify which remote object Terraform currently manages for a resource block. For the separate second criterion, terraform typically reads managed remote objects to update its knowledge before making a normal plan; the refresh may reveal drift introduced outside Terraform; this behavior should be assessed against the concrete need to identify which remote object Terraform currently manages for a resource block and compare tracked objects against current provider-reported attributes; this fulfills the need to compare tracked objects against current provider-reported attributes. Together they cover the independent tasks of identify which remote object Terraform currently manages for a resource block and compare tracked objects against current provider-reported attributes without exchanging the responsibilities of these features.

Incorrect Answers

A:

The first measure meets the requirement to identify which remote object Terraform currently manages for a resource block, but its partner serves a different role: terraform state operations and declarative moved/removed blocks are safer tools for intended transitions; hand-editing state can corrupt identifiers or dependencies; this behavior should be assessed against the concrete need to identify which remote object Terraform currently manages for a resource block and compare tracked objects against current provider-reported attributes. That second component is designed to preserve internal consistency of resource instance mappings, so the still-missing criterion is to compare tracked objects against current provider-reported attributes, while the first criterion remains identify which remote object Terraform currently manages for a resource block.

C:

The second measure does meet the compare tracked objects against current provider-reported attributes requirement, but the first is designed for another concern: An invalid or outdated state snapshot can confuse planned operations; recovery needs controlled version handling, not arbitrary deletion of an active backend; this behavior should be assessed against the concrete need to identify which remote object Terraform currently manages for a resource block and compare tracked objects against current provider-reported attributes. That first component is designed to plan how to protect, back up, and restore state deliberately, which does not accomplish the requested task to identify which remote object Terraform currently manages for a resource block, even though the other measure satisfies compare tracked objects against current provider-reported attributes.

D:

The first measure is intended to make one authoritative state accessible to a collaborating team: Remote backends centralize state storage and may offer locking; sharing a state file via Git is not an equivalent concurrency or secret-management solution; this behavior should be assessed against the concrete need to identify which remote object Terraform currently manages for a resource block and compare tracked objects against current provider-reported attributes. The second measure is intended to understand what Terraform considers its responsibility to change: Managed resources have lifecycle operations tracked through state; data sources obtain information without taking ownership of the looked-up remote resource; this behavior should be assessed against the concrete need to identify which remote object Terraform currently manages for a resource block and compare tracked objects against current provider-reported attributes. Neither is the directly designated method for the separate goals of identify which remote object Terraform currently manages for a resource block and compare tracked objects against current provider-reported attributes in this review.

Question 123

In an automated release, the requested result is to prevent dependency initialization from changing the committed lock file. What should the engineer select?

  1. Run terraform init to install plugins
  2. Diagnose an incompatible version constraint intersection
  3. Use terraform init -lockfile=readonly in CI
  4. Use TF_PLUGIN_CACHE_DIR for shared package caching

Explanation

Correct Answer

C:

Read-only mode checks the selections already committed and fails if changes are needed; it is useful for strict repeatable pipelines, not for upgrading providers; this behavior should be assessed against the concrete need to prevent dependency initialization from changing the committed lock file. This directly supports the task to prevent dependency initialization from changing the committed lock file during a module implementation.

Incorrect Answers

A:

Initialization resolves provider requirements and places plugin packages into the local cache or working data directory. plan assumes required initialization has occurred; this behavior should be assessed against the concrete need to prevent dependency initialization from changing the committed lock file. That can be useful when the aim is to download and initialize missing required providers, but it does not directly deliver the requested ability to prevent dependency initialization from changing the committed lock file.

B:

Terraform must choose a provider version satisfying all relevant module requirements; contradictory ranges cause initialization failure rather than silent dual-version installation of the same source; this behavior should be assessed against the concrete need to prevent dependency initialization from changing the committed lock file. The distinction matters here: using that mechanism to recognize why two modules can prevent provider resolution would still leave the objective to prevent dependency initialization from changing the committed lock file unmet.

D:

A plugin cache can reduce download work across directories; it does not replace the dependency lock file's selections and package-verification responsibilities; this behavior should be assessed against the concrete need to prevent dependency initialization from changing the committed lock file. The stated requirement is to prevent dependency initialization from changing the committed lock file, not to avoid repeatedly downloading the same provider binaries on a build host; this alternative addresses a different control or phase.

Question 124

An engineer needs to understand why different resource types accept different attributes as part of an automated release. Which option is the best fit?

  1. Review provider documentation for sensitive attributes
  2. Use data sources to query remote APIs
  3. Use resource schemas as the authority on arguments
  4. Recognize a provider as an API plugin

Explanation

Correct Answer

C:

Each provider publishes expected types, optional fields, and computed fields; terraform validation can reject unsupported arguments even if their names look reasonable; this behavior should be assessed against the concrete need to understand why different resource types accept different attributes. This directly supports the task to understand why different resource types accept different attributes during an infrastructure audit.

Incorrect Answers

A:

Providers decide which schema values are stored, sensitive in display, or write-only; hiding a value in output is not equivalent to omitting it from state; this behavior should be assessed against the concrete need to understand why different resource types accept different attributes. The stated requirement is to understand why different resource types accept different attributes, not to avoid assuming ordinary resource arguments hide secrets from state; this alternative addresses a different control or phase.

B:

A provider data source fetches attributes exposed by the API; it does not by itself put the looked-up object under Terraform's managed-resource lifecycle; this behavior should be assessed against the concrete need to understand why different resource types accept different attributes. That can be useful when the aim is to read information through a provider without declaring ownership of that object, but it does not directly deliver the requested ability to understand why different resource types accept different attributes.

D:

Provider binaries translate resource and data-source lifecycle requests into service-specific API calls; terraform Core builds plans and tracks dependencies, rather than implementing every cloud API directly; this behavior should be assessed against the concrete need to understand why different resource types accept different attributes. It may support a related workflow, but the question specifically requires the mechanism for understand why different resource types accept different attributes rather than map Terraform resource operations to a platform's API.

Question 125

A shared module needs more than one provider configuration. Two independent changes are requested: first, make additional provider configuration names available to child resources; second, document the plugin source and compatibility constraints inside each module. Which pair of measures fulfills both?

  1. Declare configuration_aliases in a child module + Declare required_providers separately in a child module
  2. Declare configuration_aliases in a child module + Inherit the default provider configuration into a child module
  3. Define an aliased provider block + Reference a provider alias without quotation marks
  4. Set provider = aws.west on a resource + Declare required_providers separately in a child module

Explanation

Correct Answer

A:

For the first criterion, a reusable module must declare aliases it expects in provider requirements; the caller can then pass those configurations through its module block; this behavior should be assessed against the concrete need to make additional provider configuration names available to child resources and document the plugin source and compatibility constraints inside each module; this directly addresses the need to make additional provider configuration names available to child resources. For the separate second criterion, provider configurations may be passed across modules, but source and version requirements are local to each module; explicit requirements prevent incorrect provider-source inference; this behavior should be assessed against the concrete need to make additional provider configuration names available to child resources and document the plugin source and compatibility constraints inside each module; this fulfills the need to document the plugin source and compatibility constraints inside each module. Together they cover the independent tasks of make additional provider configuration names available to child resources and document the plugin source and compatibility constraints inside each module without exchanging the responsibilities of these features.

Incorrect Answers

B:

The first measure meets the requirement to make additional provider configuration names available to child resources, but its partner serves a different role: Child modules generally inherit default provider configurations when not overridden; aliased configurations are not inherited automatically; this behavior should be assessed against the concrete need to make additional provider configuration names available to child resources and document the plugin source and compatibility constraints inside each module. That second component is designed to use the parent's ordinary provider settings without manual remapping, so the still-missing criterion is to document the plugin source and compatibility constraints inside each module, while the first criterion remains make additional provider configuration names available to child resources.

C:

The first measure is intended to create a second named configuration of the same provider: An alias identifies an alternate configuration such as another region; it does not register a different plugin source or version by itself; this behavior should be assessed against the concrete need to make additional provider configuration names available to child resources and document the plugin source and compatibility constraints inside each module. The second measure is intended to write the meta-argument as a provider configuration reference: Syntax such as provider = aws.west names the configuration; putting the reference in a string changes it from a provider reference and is not valid usage; this behavior should be assessed against the concrete need to make additional provider configuration names available to child resources and document the plugin source and compatibility constraints inside each module. Neither is the directly designated method for the separate goals of make additional provider configuration names available to child resources and document the plugin source and compatibility constraints inside each module in this review.

D:

The second measure does meet the document the plugin source and compatibility constraints inside each module requirement, but the first is designed for another concern: The provider meta-argument is a reference to a configured provider instance; without it, a resource normally selects its type's default provider; this behavior should be assessed against the concrete need to make additional provider configuration names available to child resources and document the plugin source and compatibility constraints inside each module. That first component is designed to bind an individual resource to a nondefault provider configuration, which does not accomplish the requested task to make additional provider configuration names available to child resources, even though the other measure satisfies document the plugin source and compatibility constraints inside each module.

Question 126

During a module implementation, one task is to avoid mixing independent deployments unintentionally, while another is to plan how to protect, back up, and restore state deliberately. Select the matching pair of techniques.

  1. Use state for dependency information + Treat state snapshots as recoverable but hazardous
  2. Understand one state per workspace boundary + Treat state snapshots as recoverable but hazardous
  3. Understand refresh during planning + Distinguish a managed object from a data-source read
  4. Understand one state per workspace boundary + Use a remote backend for shared state

Explanation

Correct Answer

B:

For the first criterion, different Terraform states maintain separate bindings and resource addresses; a shared configuration can therefore manage multiple environments if each has isolated state and inputs; this behavior should be assessed against the concrete need to avoid mixing independent deployments unintentionally and plan how to protect, back up, and restore state deliberately; this directly addresses the need to avoid mixing independent deployments unintentionally. For the separate second criterion, an invalid or outdated state snapshot can confuse planned operations; recovery needs controlled version handling, not arbitrary deletion of an active backend; this behavior should be assessed against the concrete need to avoid mixing independent deployments unintentionally and plan how to protect, back up, and restore state deliberately; this fulfills the need to plan how to protect, back up, and restore state deliberately. Together they cover the independent tasks of avoid mixing independent deployments unintentionally and plan how to protect, back up, and restore state deliberately without exchanging the responsibilities of these features.

Incorrect Answers

A:

The second measure does meet the plan how to protect, back up, and restore state deliberately requirement, but the first is designed for another concern: State helps Terraform track relationships and objects that may no longer be present in configuration; its purpose extends beyond saving a copy of HCL source code; this behavior should be assessed against the concrete need to avoid mixing independent deployments unintentionally and plan how to protect, back up, and restore state deliberately. That first component is designed to retain references needed to reconcile previously created resources, which does not accomplish the requested task to avoid mixing independent deployments unintentionally, even though the other measure satisfies plan how to protect, back up, and restore state deliberately.

C:

The first measure is intended to compare tracked objects against current provider-reported attributes: Terraform typically reads managed remote objects to update its knowledge before making a normal plan; the refresh may reveal drift introduced outside Terraform; this behavior should be assessed against the concrete need to avoid mixing independent deployments unintentionally and plan how to protect, back up, and restore state deliberately. The second measure is intended to understand what Terraform considers its responsibility to change: Managed resources have lifecycle operations tracked through state; data sources obtain information without taking ownership of the looked-up remote resource; this behavior should be assessed against the concrete need to avoid mixing independent deployments unintentionally and plan how to protect, back up, and restore state deliberately. Neither is the directly designated method for the separate goals of avoid mixing independent deployments unintentionally and plan how to protect, back up, and restore state deliberately in this review.

D:

The first measure meets the requirement to avoid mixing independent deployments unintentionally, but its partner serves a different role: Remote backends centralize state storage and may offer locking; sharing a state file via Git is not an equivalent concurrency or secret-management solution; this behavior should be assessed against the concrete need to avoid mixing independent deployments unintentionally and plan how to protect, back up, and restore state deliberately. That second component is designed to make one authoritative state accessible to a collaborating team, so the still-missing criterion is to plan how to protect, back up, and restore state deliberately, while the first criterion remains avoid mixing independent deployments unintentionally.

Question 127

An engineer needs to identify the registry namespace and provider type to install as part of an automated release. Which option is the best fit?

  1. Declare provider source under required_providers
  2. Commit .terraform.lock.hcl for reproducibility
  3. Use terraform init -lockfile=readonly in CI
  4. Distinguish provider requirements from provider configurations

Explanation

Correct Answer

A:

The source address identifies the plugin distribution; a local short name in HCL is only an alias within that module; terraform must resolve provider requirements during initialization; this behavior should be assessed against the concrete need to identify the registry namespace and provider type to install. This directly supports the task to identify the registry namespace and provider type to install during an infrastructure audit.

Incorrect Answers

B:

The dependency lock file constrains selection in later runs and verifies packages; it is not a lock for module releases or a storage location for state; this behavior should be assessed against the concrete need to identify the registry namespace and provider type to install. It may support a related workflow, but the question specifically requires the mechanism for identify the registry namespace and provider type to install rather than record selected provider releases and package checksums across machines.

C:

Read-only mode checks the selections already committed and fails if changes are needed; it is useful for strict repeatable pipelines, not for upgrading providers; this behavior should be assessed against the concrete need to identify the registry namespace and provider type to install. The stated requirement is to identify the registry namespace and provider type to install, not to prevent dependency initialization from changing the committed lock file; this alternative addresses a different control or phase.

D:

required_providers selects a plugin identity and versions; provider blocks hold instance settings such as region, endpoint, or authentication; this behavior should be assessed against the concrete need to identify the registry namespace and provider type to install. That can be useful when the aim is to separate which plugin to install from how it authenticates and connects, but it does not directly deliver the requested ability to identify the registry namespace and provider type to install.

Question 128

A provider integration encounters an API permission problem. The requirement is to read information through a provider without declaring ownership of that object. Which Terraform mechanism directly meets this requirement?

  1. Recognize a provider as an API plugin
  2. Use data sources to query remote APIs
  3. Recognize provider source addresses
  4. Use resource schemas as the authority on arguments

Explanation

Correct Answer

B:

A provider data source fetches attributes exposed by the API; it does not by itself put the looked-up object under Terraform's managed-resource lifecycle; this behavior should be assessed against the concrete need to read information through a provider without declaring ownership of that object. This directly supports the task to read information through a provider without declaring ownership of that object during a planned migration.

Incorrect Answers

A:

Provider binaries translate resource and data-source lifecycle requests into service-specific API calls; terraform Core builds plans and tracks dependencies, rather than implementing every cloud API directly; this behavior should be assessed against the concrete need to read information through a provider without declaring ownership of that object. That can be useful when the aim is to map Terraform resource operations to a platform's API, but it does not directly deliver the requested ability to read information through a provider without declaring ownership of that object.

C:

The source includes registry host, namespace, and type when fully qualified; local names let modules refer to that provider without repeating its entire address; this behavior should be assessed against the concrete need to read information through a provider without declaring ownership of that object. It may support a related workflow, but the question specifically requires the mechanism for read information through a provider without declaring ownership of that object rather than distinguish a local provider name from its registry namespace.

D:

Each provider publishes expected types, optional fields, and computed fields; terraform validation can reject unsupported arguments even if their names look reasonable; this behavior should be assessed against the concrete need to read information through a provider without declaring ownership of that object. The stated requirement is to read information through a provider without declaring ownership of that object, not to understand why different resource types accept different attributes; this alternative addresses a different control or phase.

Question 129

A Terraform review separates 2 requirements: (1) create a second named configuration of the same provider; (2) bind an individual resource to a nondefault provider configuration. Identify the two features that each directly handle one of those requirements. Choose TWO.

  1. Map multiple aliases for a cross-region child module
  2. Bind a data source to the appropriate provider alias
  3. Avoid provider blocks inside reusable child modules
  4. Define an aliased provider block
  5. Set provider = aws.west on a resource
  6. Declare required_providers separately in a child module

Explanation

Correct Answers

D:

An alias identifies an alternate configuration such as another region; it does not register a different plugin source or version by itself; this behavior should be assessed against the concrete need to create a second named configuration of the same provider and bind an individual resource to a nondefault provider configuration. This matches the distinct objective to create a second named configuration of the same provider; the remaining chosen features address bind an individual resource to a nondefault provider configuration.

E:

The provider meta-argument is a reference to a configured provider instance; without it, a resource normally selects its type's default provider; this behavior should be assessed against the concrete need to create a second named configuration of the same provider and bind an individual resource to a nondefault provider configuration. This matches the distinct objective to bind an individual resource to a nondefault provider configuration; the remaining chosen features address create a second named configuration of the same provider.

Incorrect Answers

A:

A child can declare distinct alias names and the caller can bind each one to a separate root configuration; passing a single default is insufficient for a two-context design; this behavior should be assessed against the concrete need to create a second named configuration of the same provider and bind an individual resource to a nondefault provider configuration. Its main application is to support a module that must address source and destination environments; the checklist instead asks for create a second named configuration of the same provider; and bind an individual resource to a nondefault provider configuration. None of those distinct criteria specifically calls for this alternative.

B:

Data sources accept provider selection as managed resources do; a lookup against the wrong default configuration may return the wrong object or no object; this behavior should be assessed against the concrete need to create a second named configuration of the same provider and bind an individual resource to a nondefault provider configuration. Its main application is to ensure reads occur in the intended service account or region; the checklist instead asks for create a second named configuration of the same provider; and bind an individual resource to a nondefault provider configuration. None of those distinct criteria specifically calls for this alternative.

C:

Child modules designed for reuse should receive provider configurations from callers; embedded provider blocks conflict with some module meta-arguments, including for_each; this behavior should be assessed against the concrete need to create a second named configuration of the same provider and bind an individual resource to a nondefault provider configuration. Its main application is to keep configurations controlled by the root for compatible module reuse; the checklist instead asks for create a second named configuration of the same provider; and bind an individual resource to a nondefault provider configuration. None of those distinct criteria specifically calls for this alternative.

F:

Provider configurations may be passed across modules, but source and version requirements are local to each module; explicit requirements prevent incorrect provider-source inference; this behavior should be assessed against the concrete need to create a second named configuration of the same provider and bind an individual resource to a nondefault provider configuration. Its main application is to document the plugin source and compatibility constraints inside each module; the checklist instead asks for create a second named configuration of the same provider; and bind an individual resource to a nondefault provider configuration. None of those distinct criteria specifically calls for this alternative.

Question 130

The immediate Terraform task is to compare tracked objects against current provider-reported attributes. Which method handles that task most directly?

  1. Treat state snapshots as recoverable but hazardous
  2. Use state for dependency information
  3. Recognize state does not equal a cloud inventory
  4. Understand refresh during planning

Explanation

Correct Answer

D:

Terraform typically reads managed remote objects to update its knowledge before making a normal plan; the refresh may reveal drift introduced outside Terraform; this behavior should be assessed against the concrete need to compare tracked objects against current provider-reported attributes. This directly supports the task to compare tracked objects against current provider-reported attributes during a platform review.

Incorrect Answers

A:

An invalid or outdated state snapshot can confuse planned operations; recovery needs controlled version handling, not arbitrary deletion of an active backend; this behavior should be assessed against the concrete need to compare tracked objects against current provider-reported attributes. It may support a related workflow, but the question specifically requires the mechanism for compare tracked objects against current provider-reported attributes rather than plan how to protect, back up, and restore state deliberately.

B:

State helps Terraform track relationships and objects that may no longer be present in configuration; its purpose extends beyond saving a copy of HCL source code; this behavior should be assessed against the concrete need to compare tracked objects against current provider-reported attributes. The stated requirement is to compare tracked objects against current provider-reported attributes, not to retain references needed to reconcile previously created resources; this alternative addresses a different control or phase.

C:

Terraform tracks objects that were created or imported into that workspace; it does not discover and adopt every service object merely because credentials permit seeing it; this behavior should be assessed against the concrete need to compare tracked objects against current provider-reported attributes. That can be useful when the aim is to understand why unmanaged existing objects do not appear automatically, but it does not directly deliver the requested ability to compare tracked objects against current provider-reported attributes.

HashiCorp Certified: Terraform Associate (Terraform Associate) Practice Tests