HashiCorp Terraform Associate 004 (HashiCorp Certified: Terraform Associate (004)) Practice Test 97

Question 960

The rollout owner asks whether Ephemeral input variable is sufficient to use a temporary credential without persisting its value into state or plan. Which limitation specifically concerns that mechanism?

  1. Such a value can be referenced only in allowed ephemeral contexts.
  2. Ordinary resource arguments marked sensitive can still end up in state.
  3. Credentials and provider configuration still require secure authentication and appropriate permissions.
  4. Marking outputs sensitive is not a substitute for backend access restrictions.

Explanation

Correct Answer

A:

For Ephemeral input variable in the task to use a temporary credential without persisting its value into state or plan, the important caution is: Such a value can be referenced only in allowed ephemeral contexts. The reason this matters is its actual behavior: ephemeral=true on a variable keeps its value available during the operation but omits it from state and plan files.

Incorrect Answers

B:

The proposed warning belongs to Secret rotation and state boundary, which serves the different goal to choose an ephemeral or write-only route when a credential must not persist, rather than to Ephemeral input variable: Terraform's ephemeral support and provider write-only arguments can avoid persisting supported temporary values. The question concerns Ephemeral input variable acting to use a temporary credential without persisting its value into state or plan, not a limit of Secret rotation and state boundary.

C:

The proposed warning belongs to Vault dynamic credentials, which serves the different goal to retrieve short-lived credentials instead of hardcoding long-term secrets, rather than to Ephemeral input variable: Vault and supported integrations can issue time-limited credentials that reduce long-lived secret exposure. The question concerns Ephemeral input variable acting to use a temporary credential without persisting its value into state or plan, not a limit of Vault dynamic credentials.

D:

The proposed warning belongs to Secure remote state storage, which serves the different goal to reduce exposure of potentially sensitive values in Terraform state, rather than to Ephemeral input variable: An access-controlled remote backend with encryption protects stored snapshots and collaboration. The question concerns Ephemeral input variable acting to use a temporary credential without persisting its value into state or plan, not a limit of Secure remote state storage.

Question 961

A colleague recommends the Terraform concept "State as synchronization metadata". Which use case best matches it?

  1. distinguish snapshots belonging to different histories
  2. protect state files even when outputs are marked sensitive
  3. support incremental reconciliation against existing remote objects
  4. map a Terraform resource address to its real remote object
  5. track repeated instances independently under count or for_each

Explanation

Correct Answer

C:

The practical result of State as synchronization metadata, used to support incremental reconciliation against existing remote objects, is: Terraform consults state rather than treating each run as a completely new unmanaged deployment. A qualification for this effect is: State still needs refresh checks to recognize external infrastructure changes.

Incorrect Answers

A:

That outcome applies to Terraform state lineage, intended to distinguish snapshots belonging to different histories, rather than the question's feature State as synchronization metadata: The lineage identifies a state history and helps detect unrelated snapshots when moving or replacing state. Unlike Terraform state lineage, State as synchronization metadata is intended to support incremental reconciliation against existing remote objects, not to distinguish snapshots belonging to different histories.

B:

That outcome applies to State sensitivity, intended to protect state files even when outputs are marked sensitive, rather than the question's feature State as synchronization metadata: Secrets and credentials can occur in Terraform state regardless of CLI redaction settings. Unlike State sensitivity, State as synchronization metadata is intended to support incremental reconciliation against existing remote objects, not to protect state files even when outputs are marked sensitive.

D:

That outcome applies to State binding identity, intended to map a Terraform resource address to its real remote object, rather than the question's feature State as synchronization metadata: State records bindings between resource instances and provider-managed objects and holds related metadata. Unlike State binding identity, State as synchronization metadata is intended to support incremental reconciliation against existing remote objects, not to map a Terraform resource address to its real remote object.

E:

That outcome applies to State and resource addresses, intended to track repeated instances independently under count or for_each, rather than the question's feature State as synchronization metadata: State holds individual addresses such as example[0] or example["dev"] for separate instances. Unlike State and resource addresses, State as synchronization metadata is intended to support incremental reconciliation against existing remote objects, not to track repeated instances independently under count or for_each.

Question 962

A Terraform rollout has two separate requirements: first, use a temporary credential without persisting its value into state or plan; second, read or generate temporary data for an operation without tracking it in state. Which assignment of mechanisms correctly handles both responsibilities?

  1. First use Ephemeral resource block; then use Ephemeral input variable.
  2. First use Ephemeral input variable; then use Ephemeral resource block.
  3. First use Vault dynamic credentials; then use Secure remote state storage.
  4. First use Ephemeral input variable; then use Vault dynamic credentials.
  5. First use Secure remote state storage; then use Ephemeral resource block.

Explanation

Correct Answer

B:

The first requirement, to use a temporary credential without persisting its value into state or plan, is handled by Ephemeral input variable: ephemeral=true on a variable keeps its value available during the operation but omits it from state and plan files. The second requirement, to read or generate temporary data for an operation without tracking it in state, is handled by Ephemeral resource block: An ephemeral block uses provider-defined temporary resources for supported runtime-only inputs. Each of these mechanisms has a distinct responsibility.

Incorrect Answers

A:

For the requested tasks to use a temporary credential without persisting its value into state or plan and read or generate temporary data for an operation without tracking it in state, the first candidate Ephemeral resource block addresses read or generate temporary data for an operation without tracking it in state; the second candidate Ephemeral input variable addresses use a temporary credential without persisting its value into state or plan. This mapping fails because the first mechanism primarily supports the task to read or generate temporary data for an operation without tracking it in state and the second mechanism primarily supports the task to use a temporary credential without persisting its value into state or plan; the actual requirements are use a temporary credential without persisting its value into state or plan first and read or generate temporary data for an operation without tracking it in state second.

C:

For the requested tasks to use a temporary credential without persisting its value into state or plan and read or generate temporary data for an operation without tracking it in state, the first candidate Vault dynamic credentials addresses retrieve short-lived credentials instead of hardcoding long-term secrets; the second candidate Secure remote state storage addresses reduce exposure of potentially sensitive values in Terraform state. This mapping fails because the first mechanism primarily supports the task to retrieve short-lived credentials instead of hardcoding long-term secrets and the second mechanism primarily supports the task to reduce exposure of potentially sensitive values in Terraform state; the actual requirements are use a temporary credential without persisting its value into state or plan first and read or generate temporary data for an operation without tracking it in state second.

D:

For the requested tasks to use a temporary credential without persisting its value into state or plan and read or generate temporary data for an operation without tracking it in state, the first candidate Ephemeral input variable addresses use a temporary credential without persisting its value into state or plan; the second candidate Vault dynamic credentials addresses retrieve short-lived credentials instead of hardcoding long-term secrets. This mapping fails because the second mechanism primarily supports the task to retrieve short-lived credentials instead of hardcoding long-term secrets; the actual requirements are use a temporary credential without persisting its value into state or plan first and read or generate temporary data for an operation without tracking it in state second.

E:

For the requested tasks to use a temporary credential without persisting its value into state or plan and read or generate temporary data for an operation without tracking it in state, the first candidate Secure remote state storage addresses reduce exposure of potentially sensitive values in Terraform state; the second candidate Ephemeral resource block addresses read or generate temporary data for an operation without tracking it in state. This mapping fails because the first mechanism primarily supports the task to reduce exposure of potentially sensitive values in Terraform state; the actual requirements are use a temporary credential without persisting its value into state or plan first and read or generate temporary data for an operation without tracking it in state second.

Question 963

A deployment design calls for a supported way to stop managing a resource while keeping its real object intact. Which mechanism most directly meets this particular need?

  1. Destroy plan preview
  2. Specific resource removal from configuration
  3. Destroy with preserved external object
  4. terraform destroy

Explanation

Correct Answer

C:

The task is to stop managing a resource while keeping its real object intact; Destroy with preserved external object directly supports that requirement: A removed block with destroy=false or careful state removal can break Terraform management without deleting the object. Its relevant boundary is: Deleting configuration without an appropriate state transition generally triggers destruction.

Incorrect Answers

A:

Destroy plan preview is designed to review a destruction proposal before running it, whereas this task is to stop managing a resource while keeping its real object intact: terraform plan -destroy produces a plan whose intended effect is to remove managed infrastructure. Against Destroy with preserved external object, its limitation is: A destroy plan itself makes no remote changes.

B:

Specific resource removal from configuration is designed to plan removal of a managed resource no longer declared in HCL, whereas this task is to stop managing a resource while keeping its real object intact: Removing a resource block normally proposes destroying its bound remote object on the next apply. Against Destroy with preserved external object, its limitation is: Use an intentional state-forgetting workflow when the object must remain.

D:

terraform destroy is designed to remove all resources managed by a selected configuration and state, whereas this task is to stop managing a resource while keeping its real object intact: terraform destroy plans and applies destruction for tracked managed objects in that workspace. Against Destroy with preserved external object, its limitation is: It does not normally destroy unrelated objects absent from that state.

Question 964

For a new infrastructure repository, the team wants to send a secret to a supporting resource without retaining it in Terraform state. Which mechanism most directly meets this particular need?

  1. Provider write-only argument
  2. Ephemeral resource block
  3. Ephemeral input variable
  4. Vault dynamic credentials
  5. Sensitive variable flag

Explanation

Correct Answer

A:

The task is to send a secret to a supporting resource without retaining it in Terraform state; Provider write-only argument directly supports that requirement: A write-only provider argument consumes a value during apply without persisting the argument in state or plan. Its relevant boundary is: Provider schema support and Terraform 1.11 or later are required.

Incorrect Answers

B:

Ephemeral resource block is designed to read or generate temporary data for an operation without tracking it in state, whereas this task is to send a secret to a supporting resource without retaining it in Terraform state: An ephemeral block uses provider-defined temporary resources for supported runtime-only inputs. Against Provider write-only argument, its limitation is: Ephemeral resources cannot be referenced in arbitrary persistent resource arguments.

C:

Ephemeral input variable is designed to use a temporary credential without persisting its value into state or plan, whereas this task is to send a secret to a supporting resource without retaining it in Terraform state: ephemeral=true on a variable keeps its value available during the operation but omits it from state and plan files. Against Provider write-only argument, its limitation is: Such a value can be referenced only in allowed ephemeral contexts.

D:

Vault dynamic credentials is designed to retrieve short-lived credentials instead of hardcoding long-term secrets, whereas this task is to send a secret to a supporting resource without retaining it in Terraform state: Vault and supported integrations can issue time-limited credentials that reduce long-lived secret exposure. Against Provider write-only argument, its limitation is: Credentials and provider configuration still require secure authentication and appropriate permissions.

E:

Sensitive variable flag is designed to redact secret values from normal Terraform CLI displays, whereas this task is to send a secret to a supporting resource without retaining it in Terraform state: sensitive=true marks an input as sensitive and propagates that sensitivity into derived expressions. Against Provider write-only argument, its limitation is: The underlying value can still be stored in state and plan artifacts.

Question 965

During an implementation review, a Terraform team encounters "Destroy with preserved external object". Which purpose is associated with that mechanism?

  1. stop managing a resource while keeping its real object intact
  2. review a destruction proposal before running it
  3. plan removal of a managed resource no longer declared in HCL
  4. remove all resources managed by a selected configuration and state
  5. limit a destructive operation to a selected object only when necessary

Explanation

Correct Answer

A:

The practical result of Destroy with preserved external object, used to stop managing a resource while keeping its real object intact, is: A removed block with destroy=false or careful state removal can break Terraform management without deleting the object. A qualification for this effect is: Deleting configuration without an appropriate state transition generally triggers destruction.

Incorrect Answers

B:

That outcome applies to Destroy plan preview, intended to review a destruction proposal before running it, rather than the question's feature Destroy with preserved external object: terraform plan -destroy produces a plan whose intended effect is to remove managed infrastructure. Unlike Destroy plan preview, Destroy with preserved external object is intended to stop managing a resource while keeping its real object intact, not to review a destruction proposal before running it.

C:

That outcome applies to Specific resource removal from configuration, intended to plan removal of a managed resource no longer declared in HCL, rather than the question's feature Destroy with preserved external object: Removing a resource block normally proposes destroying its bound remote object on the next apply. Unlike Specific resource removal from configuration, Destroy with preserved external object is intended to stop managing a resource while keeping its real object intact, not to plan removal of a managed resource no longer declared in HCL.

D:

That outcome applies to terraform destroy, intended to remove all resources managed by a selected configuration and state, rather than the question's feature Destroy with preserved external object: terraform destroy plans and applies destruction for tracked managed objects in that workspace. Unlike terraform destroy, Destroy with preserved external object is intended to stop managing a resource while keeping its real object intact, not to remove all resources managed by a selected configuration and state.

E:

That outcome applies to Targeted destruction caution, intended to limit a destructive operation to a selected object only when necessary, rather than the question's feature Destroy with preserved external object: terraform destroy -target=ADDRESS restricts action scope for exceptional situations. Unlike Targeted destruction caution, Destroy with preserved external object is intended to stop managing a resource while keeping its real object intact, not to limit a destructive operation to a selected object only when necessary.

Question 966

The team is documenting risks of State as synchronization metadata while planning to support incremental reconciliation against existing remote objects. Which caveat specifically applies to that mechanism?

  1. Changing the addressing model can require a migration to preserve bindings.
  2. It does not grant access to the remote backend.
  3. The sensitive flag hides display but does not guarantee data is absent from state.
  4. State still needs refresh checks to recognize external infrastructure changes.

Explanation

Correct Answer

D:

For State as synchronization metadata in the task to support incremental reconciliation against existing remote objects, the important caution is: State still needs refresh checks to recognize external infrastructure changes. The reason this matters is its actual behavior: Terraform consults state rather than treating each run as a completely new unmanaged deployment.

Incorrect Answers

A:

The proposed warning belongs to State and resource addresses, which serves the different goal to track repeated instances independently under count or for_each, rather than to State as synchronization metadata: State holds individual addresses such as example[0] or example["dev"] for separate instances. The question concerns State as synchronization metadata acting to support incremental reconciliation against existing remote objects, not a limit of State and resource addresses.

B:

The proposed warning belongs to Terraform state lineage, which serves the different goal to distinguish snapshots belonging to different histories, rather than to State as synchronization metadata: The lineage identifies a state history and helps detect unrelated snapshots when moving or replacing state. The question concerns State as synchronization metadata acting to support incremental reconciliation against existing remote objects, not a limit of Terraform state lineage.

C:

The proposed warning belongs to State sensitivity, which serves the different goal to protect state files even when outputs are marked sensitive, rather than to State as synchronization metadata: Secrets and credentials can occur in Terraform state regardless of CLI redaction settings. The question concerns State as synchronization metadata acting to support incremental reconciliation against existing remote objects, not a limit of State sensitivity.

Question 967

An operator chooses the mechanism "Provider write-only argument" for a Terraform project. Which outcome should this choice support?

  1. send a secret to a supporting resource without retaining it in Terraform state
  2. read or generate temporary data for an operation without tracking it in state
  3. redact secret values from normal Terraform CLI displays
  4. retrieve short-lived credentials instead of hardcoding long-term secrets

Explanation

Correct Answer

A:

The practical result of Provider write-only argument, used to send a secret to a supporting resource without retaining it in Terraform state, is: A write-only provider argument consumes a value during apply without persisting the argument in state or plan. A qualification for this effect is: Provider schema support and Terraform 1.11 or later are required.

Incorrect Answers

B:

That outcome applies to Ephemeral resource block, intended to read or generate temporary data for an operation without tracking it in state, rather than the question's feature Provider write-only argument: An ephemeral block uses provider-defined temporary resources for supported runtime-only inputs. Unlike Ephemeral resource block, Provider write-only argument is intended to send a secret to a supporting resource without retaining it in Terraform state, not to read or generate temporary data for an operation without tracking it in state.

C:

That outcome applies to Sensitive variable flag, intended to redact secret values from normal Terraform CLI displays, rather than the question's feature Provider write-only argument: sensitive=true marks an input as sensitive and propagates that sensitivity into derived expressions. Unlike Sensitive variable flag, Provider write-only argument is intended to send a secret to a supporting resource without retaining it in Terraform state, not to redact secret values from normal Terraform CLI displays.

D:

The outcome in this option belongs to Vault dynamic credentials: Vault and supported integrations can issue time-limited credentials that reduce long-lived secret exposure; by contrast, the feature actually named in the stem, Provider write-only argument, has a distinct purpose: to send a secret to a supporting resource without retaining it in Terraform state.

Question 968

Before adopting Destroy with preserved external object to stop managing a resource while keeping its real object intact, which statement sets an accurate boundary?

  1. It does not normally destroy unrelated objects absent from that state.
  2. Targeting can bypass parts of the normal complete dependency reconciliation.
  3. A destroy plan itself makes no remote changes.
  4. Use an intentional state-forgetting workflow when the object must remain.
  5. Deleting configuration without an appropriate state transition generally triggers destruction.

Explanation

Correct Answer

E:

For Destroy with preserved external object in the task to stop managing a resource while keeping its real object intact, the important caution is: Deleting configuration without an appropriate state transition generally triggers destruction. The reason this matters is its actual behavior: A removed block with destroy=false or careful state removal can break Terraform management without deleting the object.

Incorrect Answers

A:

The proposed warning belongs to terraform destroy, which serves the different goal to remove all resources managed by a selected configuration and state, rather than to Destroy with preserved external object: terraform destroy plans and applies destruction for tracked managed objects in that workspace. The question concerns Destroy with preserved external object acting to stop managing a resource while keeping its real object intact, not a limit of terraform destroy.

B:

The proposed warning belongs to Targeted destruction caution, which serves the different goal to limit a destructive operation to a selected object only when necessary, rather than to Destroy with preserved external object: terraform destroy -target=ADDRESS restricts action scope for exceptional situations. The question concerns Destroy with preserved external object acting to stop managing a resource while keeping its real object intact, not a limit of Targeted destruction caution.

C:

The proposed warning belongs to Destroy plan preview, which serves the different goal to review a destruction proposal before running it, rather than to Destroy with preserved external object: terraform plan -destroy produces a plan whose intended effect is to remove managed infrastructure. The question concerns Destroy with preserved external object acting to stop managing a resource while keeping its real object intact, not a limit of Destroy plan preview.

D:

The proposed warning belongs to Specific resource removal from configuration, which serves the different goal to plan removal of a managed resource no longer declared in HCL, rather than to Destroy with preserved external object: Removing a resource block normally proposes destroying its bound remote object on the next apply. The question concerns Destroy with preserved external object acting to stop managing a resource while keeping its real object intact, not a limit of Specific resource removal from configuration.

Question 969

A design uses Provider write-only argument to send a secret to a supporting resource without retaining it in Terraform state. Which qualification applies to the named mechanism?

  1. Ephemeral resources cannot be referenced in arbitrary persistent resource arguments.
  2. The underlying value can still be stored in state and plan artifacts.
  3. Credentials and provider configuration still require secure authentication and appropriate permissions.
  4. Provider schema support and Terraform 1.11 or later are required.

Explanation

Correct Answer

D:

For Provider write-only argument in the task to send a secret to a supporting resource without retaining it in Terraform state, the important caution is: Provider schema support and Terraform 1.11 or later are required. The reason this matters is its actual behavior: A write-only provider argument consumes a value during apply without persisting the argument in state or plan.

Incorrect Answers

A:

The proposed warning belongs to Ephemeral resource block, which serves the different goal to read or generate temporary data for an operation without tracking it in state, rather than to Provider write-only argument: An ephemeral block uses provider-defined temporary resources for supported runtime-only inputs. The question concerns Provider write-only argument acting to send a secret to a supporting resource without retaining it in Terraform state, not a limit of Ephemeral resource block.

B:

The proposed warning belongs to Sensitive variable flag, which serves the different goal to redact secret values from normal Terraform CLI displays, rather than to Provider write-only argument: sensitive=true marks an input as sensitive and propagates that sensitivity into derived expressions. The question concerns Provider write-only argument acting to send a secret to a supporting resource without retaining it in Terraform state, not a limit of Sensitive variable flag.

C:

The listed caution belongs specifically to Vault dynamic credentials, used to retrieve short-lived credentials instead of hardcoding long-term secrets: Vault and supported integrations can issue time-limited credentials that reduce long-lived secret exposure; the feature under review is instead Provider write-only argument, so this answer attaches another feature's qualification to the wrong mechanism.

Question 970

A Terraform rollout has two separate requirements: first, support incremental reconciliation against existing remote objects; second, track repeated instances independently under count or for_each. Which assignment of mechanisms correctly handles both responsibilities?

  1. First use State as synchronization metadata; then use State and resource addresses.
  2. First use State binding identity; then use Computed resource attributes in state.
  3. First use State and resource addresses; then use State as synchronization metadata.
  4. First use Computed resource attributes in state; then use State and resource addresses.
  5. First use State as synchronization metadata; then use State binding identity.

Explanation

Correct Answer

A:

The first requirement, to support incremental reconciliation against existing remote objects, is handled by State as synchronization metadata: Terraform consults state rather than treating each run as a completely new unmanaged deployment. The second requirement, to track repeated instances independently under count or for_each, is handled by State and resource addresses: State holds individual addresses such as example[0] or example["dev"] for separate instances. Each of these mechanisms has a distinct responsibility.

Incorrect Answers

B:

For the requested tasks to support incremental reconciliation against existing remote objects and track repeated instances independently under count or for_each, the first candidate State binding identity addresses map a Terraform resource address to its real remote object; the second candidate Computed resource attributes in state addresses retain IDs and other provider-returned values for future runs. This mapping fails because the first mechanism primarily supports the task to map a Terraform resource address to its real remote object and the second mechanism primarily supports the task to retain IDs and other provider-returned values for future runs; the actual requirements are support incremental reconciliation against existing remote objects first and track repeated instances independently under count or for_each second.

C:

For the requested tasks to support incremental reconciliation against existing remote objects and track repeated instances independently under count or for_each, the first candidate State and resource addresses addresses track repeated instances independently under count or for_each; the second candidate State as synchronization metadata addresses support incremental reconciliation against existing remote objects. This mapping fails because the first mechanism primarily supports the task to track repeated instances independently under count or for_each and the second mechanism primarily supports the task to support incremental reconciliation against existing remote objects; the actual requirements are support incremental reconciliation against existing remote objects first and track repeated instances independently under count or for_each second.

D:

For the requested tasks to support incremental reconciliation against existing remote objects and track repeated instances independently under count or for_each, the first candidate Computed resource attributes in state addresses retain IDs and other provider-returned values for future runs; the second candidate State and resource addresses addresses track repeated instances independently under count or for_each. This mapping fails because the first mechanism primarily supports the task to retain IDs and other provider-returned values for future runs; the actual requirements are support incremental reconciliation against existing remote objects first and track repeated instances independently under count or for_each second.

E:

For the requested tasks to support incremental reconciliation against existing remote objects and track repeated instances independently under count or for_each, the first candidate State as synchronization metadata addresses support incremental reconciliation against existing remote objects; the second candidate State binding identity addresses map a Terraform resource address to its real remote object. This mapping fails because the second mechanism primarily supports the task to map a Terraform resource address to its real remote object; the actual requirements are support incremental reconciliation against existing remote objects first and track repeated instances independently under count or for_each second.

HashiCorp Certified: Terraform Associate (004) (Terraform Associate 004) Practice Tests