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

Question 50

A reviewer has to approve a two-part design: explain why plans may propose correcting unapproved changes; additionally, avoid mixing independent deployments unintentionally. Which option pairs the correct mechanisms?

  1. Separate state from the desired configuration + Protect state as sensitive material
  2. Treat state as the resource-address-to-object mapping + Understand one state per workspace boundary
  3. Identify stale state after out-of-band edits + Understand one state per workspace boundary
  4. Identify stale state after out-of-band edits + Avoid manual state-file editing

Explanation

Correct Answer

C:

For the first criterion, when someone alters a tracked object directly, current cloud attributes can differ from state and configuration; terraform surfaces reconciliation actions during planning; this behavior should be assessed against the concrete need to explain why plans may propose correcting unapproved changes and avoid mixing independent deployments unintentionally; this directly addresses the need to explain why plans may propose correcting unapproved changes. For the separate second 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 explain why plans may propose correcting unapproved changes and avoid mixing independent deployments unintentionally; this fulfills the need to avoid mixing independent deployments unintentionally. Together they cover the independent tasks of explain why plans may propose correcting unapproved changes and avoid mixing independent deployments unintentionally without exchanging the responsibilities of these features.

Incorrect Answers

A:

The first measure is intended to recognize that a state entry is not a request to keep an object forever: Configuration declares intended resources while state records what Terraform tracks; removing a block can plan destruction unless a supported removal mechanism changes that intent; this behavior should be assessed against the concrete need to explain why plans may propose correcting unapproved changes and avoid mixing independent deployments unintentionally. The second measure is intended to prevent unauthorized access to stored resource attributes: State can hold secrets and identifiers even when CLI output masks a sensitive value; encryption and strict backend access control are important; this behavior should be assessed against the concrete need to explain why plans may propose correcting unapproved changes and avoid mixing independent deployments unintentionally. Neither is the directly designated method for the separate goals of explain why plans may propose correcting unapproved changes and avoid mixing independent deployments unintentionally in this review.

B:

The second measure does meet the avoid mixing independent deployments unintentionally requirement, but the first is designed for another concern: 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 explain why plans may propose correcting unapproved changes and avoid mixing independent deployments unintentionally. That first component is designed to identify which remote object Terraform currently manages for a resource block, which does not accomplish the requested task to explain why plans may propose correcting unapproved changes, even though the other measure satisfies avoid mixing independent deployments unintentionally.

D:

The first measure meets the requirement to explain why plans may propose correcting unapproved changes, 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 explain why plans may propose correcting unapproved changes and avoid mixing independent deployments unintentionally. That second component is designed to preserve internal consistency of resource instance mappings, so the still-missing criterion is to avoid mixing independent deployments unintentionally, while the first criterion remains explain why plans may propose correcting unapproved changes.

Question 51

A developer is troubleshooting plugin selection after a version change. Two independent changes are requested: first, record selected provider releases and package checksums across machines; second, prevent dependency initialization from changing the committed lock file. Which pair of measures fulfills both?

  1. Run terraform init -upgrade deliberately + Use terraform init -lockfile=readonly in CI
  2. Run terraform init to install plugins + Use TF_PLUGIN_CACHE_DIR for shared package caching
  3. Commit .terraform.lock.hcl for reproducibility + Use terraform init -lockfile=readonly in CI
  4. Commit .terraform.lock.hcl for reproducibility + Inspect selected providers with terraform providers
  5. Diagnose an incompatible version constraint intersection + Use terraform init -lockfile=readonly in CI
  6. Commit .terraform.lock.hcl for reproducibility + Distinguish provider requirements from provider configurations

Explanation

Correct Answer

C:

For the first criterion, 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 record selected provider releases and package checksums across machines and prevent dependency initialization from changing the committed lock file; this directly addresses the need to record selected provider releases and package checksums across machines. For the separate second criterion, 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 record selected provider releases and package checksums across machines and prevent dependency initialization from changing the committed lock file; this fulfills the need to prevent dependency initialization from changing the committed lock file. Together they cover the independent tasks of record selected provider releases and package checksums across machines and prevent dependency initialization from changing the committed lock file without exchanging the responsibilities of these features.

Incorrect Answers

A:

The second measure does meet the prevent dependency initialization from changing the committed lock file requirement, but the first is designed for another concern: Upgrade mode asks Terraform to reconsider provider and module selections instead of preserving the existing lockfile choice; it still respects configured version requirements; this behavior should be assessed against the concrete need to record selected provider releases and package checksums across machines and prevent dependency initialization from changing the committed lock file. That first component is designed to reselect newer eligible provider releases within declared constraints, which does not accomplish the requested task to record selected provider releases and package checksums across machines, even though the other measure satisfies prevent dependency initialization from changing the committed lock file.

B:

The first measure is intended to download and initialize missing required providers: 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 record selected provider releases and package checksums across machines and prevent dependency initialization from changing the committed lock file. The second measure is intended to avoid repeatedly downloading the same provider binaries on a build host: 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 record selected provider releases and package checksums across machines and prevent dependency initialization from changing the committed lock file. Neither is the directly designated method for the separate goals of record selected provider releases and package checksums across machines and prevent dependency initialization from changing the committed lock file in this review.

D:

The first measure meets the requirement to record selected provider releases and package checksums across machines, but its partner serves a different role: The command reports the provider dependency tree and can aid source/version troubleshooting; it does not rewrite constraints or upgrade plugin packages; this behavior should be assessed against the concrete need to record selected provider releases and package checksums across machines and prevent dependency initialization from changing the committed lock file. That second component is designed to see the provider requirements for the root and child modules, so the still-missing criterion is to prevent dependency initialization from changing the committed lock file, while the first criterion remains record selected provider releases and package checksums across machines.

E:

The second measure does meet the prevent dependency initialization from changing the committed lock file requirement, but the first is designed for another concern: 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 record selected provider releases and package checksums across machines and prevent dependency initialization from changing the committed lock file. That first component is designed to recognize why two modules can prevent provider resolution, which does not accomplish the requested task to record selected provider releases and package checksums across machines, even though the other measure satisfies prevent dependency initialization from changing the committed lock file.

F:

The first measure meets the requirement to record selected provider releases and package checksums across machines, but its partner serves a different role: 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 record selected provider releases and package checksums across machines and prevent dependency initialization from changing the committed lock file. That second component is designed to separate which plugin to install from how it authenticates and connects, so the still-missing criterion is to prevent dependency initialization from changing the committed lock file, while the first criterion remains record selected provider releases and package checksums across machines.

Question 52

During a module implementation, one task is to use values learned only after resource creation or refresh, while another is to separate provider release changes from upgrading Terraform CLI. Select the matching pair of techniques.

  1. Read provider-computed attributes + Understand a provider plugin's version independence
  2. Recognize provider source addresses + Understand a provider plugin's version independence
  3. Configure a provider's authentication + Avoid assuming providers install automatically at apply
  4. Read provider-computed attributes + Handle provider-specific constraints

Explanation

Correct Answer

A:

For the first criterion, a provider may return IDs or addresses that were unknown during initial planning; terraform can propagate unknown values through references until the apply produces them; this behavior should be assessed against the concrete need to use values learned only after resource creation or refresh and separate provider release changes from upgrading Terraform CLI; this directly addresses the need to use values learned only after resource creation or refresh. For the separate second criterion, 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 use values learned only after resource creation or refresh and separate provider release changes from upgrading Terraform CLI; this fulfills the need to separate provider release changes from upgrading Terraform CLI. Together they cover the independent tasks of use values learned only after resource creation or refresh and separate provider release changes from upgrading Terraform CLI without exchanging the responsibilities of these features.

Incorrect Answers

B:

The second measure does meet the separate provider release changes from upgrading Terraform CLI requirement, but the first is designed for another concern: 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 use values learned only after resource creation or refresh and separate provider release changes from upgrading Terraform CLI. That first component is designed to distinguish a local provider name from its registry namespace, which does not accomplish the requested task to use values learned only after resource creation or refresh, even though the other measure satisfies separate provider release changes from upgrading Terraform CLI.

C:

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 use values learned only after resource creation or refresh and separate provider release changes from upgrading Terraform CLI. The second measure is intended to ensure dependencies are installed during initialization: Terraform initialization installs provider dependencies before normal plan/apply runs; missing plugin setup cannot be solved solely by granting more cloud permissions; this behavior should be assessed against the concrete need to use values learned only after resource creation or refresh and separate provider release changes from upgrading Terraform CLI. Neither is the directly designated method for the separate goals of use values learned only after resource creation or refresh and separate provider release changes from upgrading Terraform CLI in this review.

D:

The first measure meets the requirement to use values learned only after resource creation or refresh, but its partner serves a different role: Each service API determines supported operations, defaults, quotas, and replacement rules; the shared HCL syntax does not standardize these platform behaviors; this behavior should be assessed against the concrete need to use values learned only after resource creation or refresh and separate provider release changes from upgrading Terraform CLI. That second component is designed to avoid assuming one cloud plugin exposes the same resource semantics as another, so the still-missing criterion is to separate provider release changes from upgrading Terraform CLI, while the first criterion remains use values learned only after resource creation or refresh.

Question 53

A reviewer has to approve a two-part design: keep configurations controlled by the root for compatible module reuse; additionally, ensure reads occur in the intended service account or region. Which option pairs the correct mechanisms?

  1. Avoid provider blocks inside reusable child modules + Bind a data source to the appropriate provider alias
  2. Avoid provider blocks inside reusable child modules + Use different local provider names for distinct plugin sources
  3. Inherit the default provider configuration into a child module + Reference a provider alias without quotation marks
  4. Declare configuration_aliases in a child module + Bind a data source to the appropriate provider alias

Explanation

Correct Answer

A:

For the first criterion, 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 keep configurations controlled by the root for compatible module reuse and ensure reads occur in the intended service account or region; this directly addresses the need to keep configurations controlled by the root for compatible module reuse. For the separate second criterion, 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 keep configurations controlled by the root for compatible module reuse and ensure reads occur in the intended service account or region; this fulfills the need to ensure reads occur in the intended service account or region. Together they cover the independent tasks of keep configurations controlled by the root for compatible module reuse and ensure reads occur in the intended service account or region without exchanging the responsibilities of these features.

Incorrect Answers

B:

The first measure meets the requirement to keep configurations controlled by the root for compatible module reuse, but its partner serves a different role: The local name maps a provider source to an identifier in a module; two sources require distinct local names even if their human-facing functions overlap; this behavior should be assessed against the concrete need to keep configurations controlled by the root for compatible module reuse and ensure reads occur in the intended service account or region. That second component is designed to avoid confusing multiple plugins with the same type suffix, so the still-missing criterion is to ensure reads occur in the intended service account or region, while the first criterion remains keep configurations controlled by the root for compatible module reuse.

C:

The first measure is intended to use the parent's ordinary provider settings without manual remapping: 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 keep configurations controlled by the root for compatible module reuse and ensure reads occur in the intended service account or region. 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 keep configurations controlled by the root for compatible module reuse and ensure reads occur in the intended service account or region. Neither is the directly designated method for the separate goals of keep configurations controlled by the root for compatible module reuse and ensure reads occur in the intended service account or region in this review.

D:

The second measure does meet the ensure reads occur in the intended service account or region requirement, but the first is designed for another concern: 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 keep configurations controlled by the root for compatible module reuse and ensure reads occur in the intended service account or region. That first component is designed to make additional provider configuration names available to child resources, which does not accomplish the requested task to keep configurations controlled by the root for compatible module reuse, even though the other measure satisfies ensure reads occur in the intended service account or region.

Question 54

In a planned migration, the requested result is to plan how to protect, back up, and restore state deliberately. What should the engineer select?

  1. Distinguish a managed object from a data-source read
  2. Treat state snapshots as recoverable but hazardous
  3. Separate state from the desired configuration
  4. Identify stale state after out-of-band edits

Explanation

Correct Answer

B:

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 plan how to protect, back up, and restore state deliberately. This directly supports the task to plan how to protect, back up, and restore state deliberately during a deployment checklist.

Incorrect Answers

A:

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 plan how to protect, back up, and restore state deliberately. The stated requirement is to plan how to protect, back up, and restore state deliberately, not to understand what Terraform considers its responsibility to change; this alternative addresses a different control or phase.

C:

Configuration declares intended resources while state records what Terraform tracks; removing a block can plan destruction unless a supported removal mechanism changes that intent; this behavior should be assessed against the concrete need to plan how to protect, back up, and restore state deliberately. The distinction matters here: using that mechanism to recognize that a state entry is not a request to keep an object forever would still leave the objective to plan how to protect, back up, and restore state deliberately unmet.

D:

When someone alters a tracked object directly, current cloud attributes can differ from state and configuration; terraform surfaces reconciliation actions during planning; this behavior should be assessed against the concrete need to plan how to protect, back up, and restore state deliberately. It may support a related workflow, but the question specifically requires the mechanism for plan how to protect, back up, and restore state deliberately rather than explain why plans may propose correcting unapproved changes.

Question 55

During a module implementation, one task is to specify which Terraform CLI versions may interpret this configuration, while another is to recognize why two modules can prevent provider resolution. Select the matching pair of techniques.

  1. Constrain required_version for Terraform Core + Diagnose an incompatible version constraint intersection
  2. Set a provider version constraint + Diagnose an incompatible version constraint intersection
  3. Constrain required_version for Terraform Core + Run terraform init to install plugins
  4. Distinguish provider requirements from provider configurations + Understand checksums in the lock file
  5. Commit .terraform.lock.hcl for reproducibility + Diagnose an incompatible version constraint intersection

Explanation

Correct Answer

A:

For the first criterion, the top-level Terraform version constraint concerns the CLI executable, not a provider plugin; provider requirements belong in required_providers; this behavior should be assessed against the concrete need to specify which Terraform CLI versions may interpret this configuration and recognize why two modules can prevent provider resolution; this directly addresses the need to specify which Terraform CLI versions may interpret this configuration. For the separate second criterion, 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 specify which Terraform CLI versions may interpret this configuration and recognize why two modules can prevent provider resolution; this fulfills the need to recognize why two modules can prevent provider resolution. Together they cover the independent tasks of specify which Terraform CLI versions may interpret this configuration and recognize why two modules can prevent provider resolution without exchanging the responsibilities of these features.

Incorrect Answers

B:

The second measure does meet the recognize why two modules can prevent provider resolution requirement, but the first is designed for another concern: A constraint such as ~> 5.0 filters available versions by compatibility; it is not a request to install any arbitrarily newer major version; this behavior should be assessed against the concrete need to specify which Terraform CLI versions may interpret this configuration and recognize why two modules can prevent provider resolution. That first component is designed to restrict which plugin releases are eligible for installation, which does not accomplish the requested task to specify which Terraform CLI versions may interpret this configuration, even though the other measure satisfies recognize why two modules can prevent provider resolution.

C:

The first measure meets the requirement to specify which Terraform CLI versions may interpret this configuration, but its partner serves a different role: 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 specify which Terraform CLI versions may interpret this configuration and recognize why two modules can prevent provider resolution. That second component is designed to download and initialize missing required providers, so the still-missing criterion is to recognize why two modules can prevent provider resolution, while the first criterion remains specify which Terraform CLI versions may interpret this configuration.

D:

The first measure is intended to separate which plugin to install from how it authenticates and connects: 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 specify which Terraform CLI versions may interpret this configuration and recognize why two modules can prevent provider resolution. The second measure is intended to verify installed provider packages against trusted recorded hashes: Hashes help detect unexpected package changes; they do not validate that a plugin's credentials have sufficient rights at a remote API; this behavior should be assessed against the concrete need to specify which Terraform CLI versions may interpret this configuration and recognize why two modules can prevent provider resolution. Neither is the directly designated method for the separate goals of specify which Terraform CLI versions may interpret this configuration and recognize why two modules can prevent provider resolution in this review.

E:

The second measure does meet the recognize why two modules can prevent provider resolution requirement, but the first is designed for another concern: 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 specify which Terraform CLI versions may interpret this configuration and recognize why two modules can prevent provider resolution. That first component is designed to record selected provider releases and package checksums across machines, which does not accomplish the requested task to specify which Terraform CLI versions may interpret this configuration, even though the other measure satisfies recognize why two modules can prevent provider resolution.

Question 56

The immediate Terraform task is to avoid assuming one cloud plugin exposes the same resource semantics as another. Which method handles that task most directly?

  1. Handle provider-specific constraints
  2. Read provider-computed attributes
  3. Review provider documentation for sensitive attributes
  4. Avoid assuming providers install automatically at apply
  5. Select a provider using the resource type prefix
  6. Understand a provider plugin's version independence

Explanation

Correct Answer

A:

Each service API determines supported operations, defaults, quotas, and replacement rules; the shared HCL syntax does not standardize these platform behaviors; this behavior should be assessed against the concrete need to avoid assuming one cloud plugin exposes the same resource semantics as another. This directly supports the task to avoid assuming one cloud plugin exposes the same resource semantics as another during a platform review.

Incorrect Answers

B:

A provider may return IDs or addresses that were unknown during initial planning; terraform can propagate unknown values through references until the apply produces them; this behavior should be assessed against the concrete need to avoid assuming one cloud plugin exposes the same resource semantics as another. The stated requirement is to avoid assuming one cloud plugin exposes the same resource semantics as another, not to use values learned only after resource creation or refresh; this alternative addresses a different control or phase.

C:

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 avoid assuming one cloud plugin exposes the same resource semantics as another. That can be useful when the aim is to avoid assuming ordinary resource arguments hide secrets from state, but it does not directly deliver the requested ability to avoid assuming one cloud plugin exposes the same resource semantics as another.

D:

Terraform initialization installs provider dependencies before normal plan/apply runs; missing plugin setup cannot be solved solely by granting more cloud permissions; this behavior should be assessed against the concrete need to avoid assuming one cloud plugin exposes the same resource semantics as another. The distinction matters here: using that mechanism to ensure dependencies are installed during initialization would still leave the objective to avoid assuming one cloud plugin exposes the same resource semantics as another unmet.

E:

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 avoid assuming one cloud plugin exposes the same resource semantics as another. It may support a related workflow, but the question specifically requires the mechanism for avoid assuming one cloud plugin exposes the same resource semantics as another rather than understand how an unqualified resource chooses its default provider.

F:

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 avoid assuming one cloud plugin exposes the same resource semantics as another. The stated requirement is to avoid assuming one cloud plugin exposes the same resource semantics as another, not to separate provider release changes from upgrading Terraform CLI; this alternative addresses a different control or phase.

Question 57

In a planned migration, the requested result is to make additional provider configuration names available to child resources. What should the engineer select?

  1. Declare required_providers separately in a child module
  2. Bind a data source to the appropriate provider alias
  3. Understand the implied empty default provider configuration
  4. Declare configuration_aliases in a child module

Explanation

Correct Answer

D:

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. This directly supports the task to make additional provider configuration names available to child resources during a deployment checklist.

Incorrect Answers

A:

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. The distinction matters here: using that mechanism to document the plugin source and compatibility constraints inside each module would still leave the objective to make additional provider configuration names available to child resources unmet.

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 make additional provider configuration names available to child resources. It may support a related workflow, but the question specifically requires the mechanism for make additional provider configuration names available to child resources rather than ensure reads occur in the intended service account or region.

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 make additional provider configuration names available to child resources. The stated requirement is to make additional provider configuration names available to child resources, not to diagnose failures when only aliases are configured; this alternative addresses a different control or phase.

Question 58

A team is investigating why Terraform recognizes remote objects. The team must both understand what Terraform considers its responsibility to change and understand why unmanaged existing objects do not appear automatically. Which paired choice implements those distinct goals?

  1. Understand refresh during planning + Treat state as the resource-address-to-object mapping
  2. Distinguish a managed object from a data-source read + Recognize state does not equal a cloud inventory
  3. Identify stale state after out-of-band edits + Recognize state does not equal a cloud inventory
  4. Distinguish a managed object from a data-source read + Understand one state per workspace boundary

Explanation

Correct Answer

B:

For the first criterion, 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 understand what Terraform considers its responsibility to change and understand why unmanaged existing objects do not appear automatically; this directly addresses the need to understand what Terraform considers its responsibility to change. For the separate second criterion, 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 understand what Terraform considers its responsibility to change and understand why unmanaged existing objects do not appear automatically; this fulfills the need to understand why unmanaged existing objects do not appear automatically. Together they cover the independent tasks of understand what Terraform considers its responsibility to change and understand why unmanaged existing objects do not appear automatically without exchanging the responsibilities of these features.

Incorrect Answers

A:

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 understand what Terraform considers its responsibility to change and understand why unmanaged existing objects do not appear automatically. The second measure is intended to identify which remote object Terraform currently manages for a resource block: 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 understand what Terraform considers its responsibility to change and understand why unmanaged existing objects do not appear automatically. Neither is the directly designated method for the separate goals of understand what Terraform considers its responsibility to change and understand why unmanaged existing objects do not appear automatically in this review.

C:

The second measure does meet the understand why unmanaged existing objects do not appear automatically requirement, but the first is designed for another concern: When someone alters a tracked object directly, current cloud attributes can differ from state and configuration; terraform surfaces reconciliation actions during planning; this behavior should be assessed against the concrete need to understand what Terraform considers its responsibility to change and understand why unmanaged existing objects do not appear automatically. That first component is designed to explain why plans may propose correcting unapproved changes, which does not accomplish the requested task to understand what Terraform considers its responsibility to change, even though the other measure satisfies understand why unmanaged existing objects do not appear automatically.

D:

The first measure meets the requirement to understand what Terraform considers its responsibility to change, but its partner serves a different role: 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 understand what Terraform considers its responsibility to change and understand why unmanaged existing objects do not appear automatically. That second component is designed to avoid mixing independent deployments unintentionally, so the still-missing criterion is to understand why unmanaged existing objects do not appear automatically, while the first criterion remains understand what Terraform considers its responsibility to change.

Question 59

A CI runner is reproducing dependency installations. The checklist contains independent tasks: (1) separate which plugin to install from how it authenticates and connects; (2) avoid repeatedly downloading the same provider binaries on a build host. Which two options directly correspond to the respective tasks? Choose TWO.

  1. Run terraform init to install plugins
  2. Use TF_PLUGIN_CACHE_DIR for shared package caching
  3. Use terraform init -lockfile=readonly in CI
  4. Commit .terraform.lock.hcl for reproducibility
  5. Distinguish provider requirements from provider configurations

Explanation

Correct Answers

B:

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 separate which plugin to install from how it authenticates and connects and avoid repeatedly downloading the same provider binaries on a build host. This matches the distinct objective to avoid repeatedly downloading the same provider binaries on a build host; the remaining chosen features address separate which plugin to install from how it authenticates and connects.

E:

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 separate which plugin to install from how it authenticates and connects and avoid repeatedly downloading the same provider binaries on a build host. This matches the distinct objective to separate which plugin to install from how it authenticates and connects; the remaining chosen features address avoid repeatedly downloading the same provider binaries on a build host.

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 separate which plugin to install from how it authenticates and connects and avoid repeatedly downloading the same provider binaries on a build host. Its main application is to download and initialize missing required providers; the checklist instead asks for separate which plugin to install from how it authenticates and connects; and avoid repeatedly downloading the same provider binaries on a build host. None of those distinct criteria specifically calls for this alternative.

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 separate which plugin to install from how it authenticates and connects and avoid repeatedly downloading the same provider binaries on a build host. Its main application is to prevent dependency initialization from changing the committed lock file; the checklist instead asks for separate which plugin to install from how it authenticates and connects; and avoid repeatedly downloading the same provider binaries on a build host. None of those distinct criteria specifically calls for this alternative.

D:

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 separate which plugin to install from how it authenticates and connects and avoid repeatedly downloading the same provider binaries on a build host. Its main application is to record selected provider releases and package checksums across machines; the checklist instead asks for separate which plugin to install from how it authenticates and connects; and avoid repeatedly downloading the same provider binaries on a build host. None of those distinct criteria specifically calls for this alternative.

Question 60

In a planned migration, the requested result is to supply credentials and settings needed for remote API requests. What should the engineer select?

  1. Configure a provider's authentication
  2. Distinguish Terraform Core from provider plugins
  3. Review provider documentation for sensitive attributes
  4. Recognize provider source addresses
  5. Read provider-computed attributes

Explanation

Correct Answer

A:

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 supply credentials and settings needed for remote API requests. This directly supports the task to supply credentials and settings needed for remote API requests during a deployment checklist.

Incorrect Answers

B:

Core evaluates configuration and plans operations; a provider talks to its specific API to create, read, update, or delete objects; an API authorization error therefore usually needs provider-side credential review; this behavior should be assessed against the concrete need to supply credentials and settings needed for remote API requests. That can be useful when the aim is to locate graph, evaluation, state, and orchestration responsibilities, but it does not directly deliver the requested ability to supply credentials and settings needed for remote API requests.

C:

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 supply credentials and settings needed for remote API requests. The distinction matters here: using that mechanism to avoid assuming ordinary resource arguments hide secrets from state would still leave the objective to supply credentials and settings needed for remote API requests unmet.

D:

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 supply credentials and settings needed for remote API requests. It may support a related workflow, but the question specifically requires the mechanism for supply credentials and settings needed for remote API requests rather than distinguish a local provider name from its registry namespace.

E:

A provider may return IDs or addresses that were unknown during initial planning; terraform can propagate unknown values through references until the apply produces them; this behavior should be assessed against the concrete need to supply credentials and settings needed for remote API requests. The stated requirement is to supply credentials and settings needed for remote API requests, not to use values learned only after resource creation or refresh; this alternative addresses a different control or phase.

HashiCorp Certified: Terraform Associate (Terraform Associate) Practice Tests