Question 1060
A build job for a Terraform configuration needs to interpret a plan showing a resource that Terraform will destroy. Which feature or operation is the most direct match?
- The dependency graph during planning
- A resource action marked minus
- terraform plan -refresh=false
- terraform plan -replace
Explanation
Correct Answer
B:In human-readable plans, - denotes a planned destruction of a managed resource; this directly meets the requirement to interpret a plan showing a resource that Terraform will destroy. By comparison, terraform plan -refresh=false is intended to skip routine state refresh for a constrained preview, which is a different task from interpret a plan showing a resource that Terraform will destroy.
Incorrect Answers
A:Terraform graph nodes can run concurrently when no dependency edge requires a particular order; this mechanism is useful when the job is to explain why two unrelated resources can be planned and applied in parallel, whereas the current scenario requires the engineer to interpret a plan showing a resource that Terraform will destroy. These operations have different effects in the stated Terraform workflow.
C:Disabling refresh reduces remote reads but can hide drift and produce an inaccurate plan based on stale observations; this mechanism is useful when the job is to skip routine state refresh for a constrained preview, whereas the current scenario requires the engineer to interpret a plan showing a resource that Terraform will destroy. These operations have different effects in the stated Terraform workflow.
D:The -replace=ADDRESS option requests replacement of a particular managed instance even if ordinary change detection would update it in place or do nothing; this mechanism is useful when the job is to force a resource instance to be replaced during planning, whereas the current scenario requires the engineer to interpret a plan showing a resource that Terraform will destroy. These operations have different effects in the stated Terraform workflow.
Question 1061
A Terraform reviewer encounters “A CLI-driven workspace” while assessing how to upload local configuration for execution through HCP Terraform rather than relying on Git webhooks. Which statement correctly describes its actual behavior?
- HCP Terraform can run the apply stage after its configured approval, policy and workflow requirements are satisfied.
- A CLI workflow can send configuration from the Terraform CLI to HCP Terraform for workspace runs.
- HCP Terraform runs have plan stages where proposed infrastructure operations can be inspected and checked.
- HCP Terraform maintains workspace state versions and supports collaboration without exposing a machine-local canonical state file.
Explanation
Correct Answer
B:The named mechanism is used when the objective is to upload local configuration for execution through HCP Terraform rather than relying on Git webhooks, so it produces the behavior described. In contrast, HCP Terraform remote state serves a different goal: store Terraform state under managed service controls rather than a local file, not upload local configuration for execution through HCP Terraform rather than relying on Git webhooks.
Incorrect Answers
A:The description applies to a run apply phase when an engineer needs to execute approved resource changes within an HCP Terraform workspace; the named a CLI-driven workspace instead handles the requirement to upload local configuration for execution through HCP Terraform rather than relying on Git webhooks, so this behavior does not describe A CLI-driven workspace in the situation named.
C:The description applies to a run plan phase when an engineer needs to review infrastructure differences before applying a workspace change; the named a CLI-driven workspace instead handles the requirement to upload local configuration for execution through HCP Terraform rather than relying on Git webhooks, so this behavior does not describe A CLI-driven workspace in the situation named.
D:The description applies to HCP Terraform remote state when an engineer needs to store Terraform state under managed service controls rather than a local file; the named a CLI-driven workspace instead handles the requirement to upload local configuration for execution through HCP Terraform rather than relying on Git webhooks, so this behavior does not describe A CLI-driven workspace in the situation named.
Question 1062
An operations runbook for tracked objects requires a way to enumerate managed resource instance addresses in the current state. Which Terraform approach most directly fulfills that request?
- terraform state list
- terraform workspace select
- terraform show -json
- terraform state rm
Explanation
Correct Answer
A:The state list subcommand prints stored addresses without changing infrastructure or state content; this directly meets the requirement to enumerate managed resource instance addresses in the current state. By comparison, terraform workspace select is intended to switch the currently selected Terraform CLI workspace, which is a different task from enumerate managed resource instance addresses in the current state.
Incorrect Answers
B:Workspace selection changes which workspace state namespace the root configuration uses; it does not select a cloud account automatically; this mechanism is useful when the job is to switch the currently selected Terraform CLI workspace, whereas the current scenario requires the engineer to enumerate managed resource instance addresses in the current state. These operations have different effects in the stated Terraform workflow.
C:The JSON representation supports automated inspection but must be protected because redacted display is not a security boundary; this mechanism is useful when the job is to read plan or state information in a structured representation, whereas the current scenario requires the engineer to enumerate managed resource instance addresses in the current state. These operations have different effects in the stated Terraform workflow.
D:State rm deletes the state association, not the object in the external system; this mechanism is useful when the job is to stop tracking a resource without telling its provider to delete the remote object, whereas the current scenario requires the engineer to enumerate managed resource instance addresses in the current state. These operations have different effects in the stated Terraform workflow.
Question 1063
A Terraform deployment has independent requirements: (1) intentionally reconsider previously locked provider and module selections; (2) read an object from a secondary account rather than the default account. Which TWO mechanisms directly address these needs? Choose TWO.
- Provider configuration at the root
- terraform init -upgrade
- A provider source address
- An aliased provider instance
- Explicit provider selection on data blocks
Explanation
Correct Answers
B:The -upgrade switch permits newer versions that satisfy constraints instead of preserving current installed or locked selections; this meets the requirement to intentionally reconsider previously locked provider and module selections, while the other selected techniques address read an object from a secondary account rather than the default account, which require their own distinct Terraform mechanisms.
E:A data block can set provider = aws.secondary to query through an alternate provider configuration; this meets the requirement to read an object from a secondary account rather than the default account, while the other selected techniques address intentionally reconsider previously locked provider and module selections, which require their own distinct Terraform mechanisms.
Incorrect Answers
A:Reusable child modules should primarily declare provider requirements and receive configurations from callers rather than embedding fixed credentials; it addresses supply provider configurations from the root module to reusable child modules, but this delivery instead requires intentionally reconsider previously locked provider and module selections and read an object from a secondary account rather than the default account. The required combination involves terraform init -upgrade and Explicit provider selection on data blocks, not the behavior of Provider configuration at the root.
C:The source address identifies a provider by registry hostname, namespace and type; local names alone are insufficient to distinguish publishers; it addresses distinguish a community plugin from the HashiCorp-maintained plugin with the same local name, but this delivery instead requires intentionally reconsider previously locked provider and module selections and read an object from a secondary account rather than the default account. The required combination involves terraform init -upgrade and Explicit provider selection on data blocks, not the behavior of A provider source address.
D:Declare an aliased provider configuration and assign provider = provider_name.alias on resources that need the alternate region; it addresses create resources in a second region using the same provider type, but this delivery instead requires intentionally reconsider previously locked provider and module selections and read an object from a secondary account rather than the default account. The required combination involves terraform init -upgrade and Explicit provider selection on data blocks, not the behavior of An aliased provider instance.
Question 1064
During a design review, the requirement is to propose updating state or root outputs to reflect remote changes without planning infrastructure remediation. Which option should the engineer select?
- A replacement action in the plan
- A resource action marked plus
- terraform plan -refresh-only
- A resource action marked minus
- An unknown value until apply
Explanation
Correct Answer
C:Refresh-only planning proposes changes to Terraform state or root outputs based on remote observations, without proposing ordinary resource updates; this directly meets the requirement to propose updating state or root outputs to reflect remote changes without planning infrastructure remediation. By comparison, a resource action marked minus is intended to interpret a plan showing a resource that Terraform will destroy, which is a different task from propose updating state or root outputs to reflect remote changes without planning infrastructure remediation.
Incorrect Answers
A:Plans show replacement when the provider cannot update a changed property in place; create-before-destroy can change the replacement order; this mechanism is useful when the job is to recognize a destroy-and-create operation for an immutable argument, whereas the current scenario requires the engineer to propose updating state or root outputs to reflect remote changes without planning infrastructure remediation. These operations have different effects in the stated Terraform workflow.
B:In conventional human-readable plans, + signifies that a managed resource is proposed for creation; this mechanism is useful when the job is to interpret the leading + symbol in Terraform's plan, whereas the current scenario requires the engineer to propose updating state or root outputs to reflect remote changes without planning infrastructure remediation. These operations have different effects in the stated Terraform workflow.
D:In human-readable plans, - denotes a planned destruction of a managed resource; this mechanism is useful when the job is to interpret a plan showing a resource that Terraform will destroy, whereas the current scenario requires the engineer to propose updating state or root outputs to reflect remote changes without planning infrastructure remediation. These operations have different effects in the stated Terraform workflow.
E:Terraform may mark attributes as known after apply because a provider assigns their values only when creating or updating a real object; this mechanism is useful when the job is to understand why a computed attribute is unavailable in the preview, whereas the current scenario requires the engineer to propose updating state or root outputs to reflect remote changes without planning infrastructure remediation. These operations have different effects in the stated Terraform workflow.
Question 1065
During a design review, the requirement is to associate one existing remote object with a configured resource address. Which option should the engineer select?
- terraform import ADDRESS ID
- A matching resource declaration
- An import configuration review
- terraform plan -generate-config-out
Explanation
Correct Answer
A:The import CLI command records a provider-defined remote ID at a Terraform address but does not automatically write a complete resource block; this directly meets the requirement to associate one existing remote object with a configured resource address. By comparison, terraform plan -generate-config-out is intended to produce draft HCL for resources named in import blocks without matching configuration, which is a different task from associate one existing remote object with a configured resource address.
Incorrect Answers
B:Imported infrastructure should have a corresponding resource block with configuration matching the desired attributes so the next plan is safe; this mechanism is useful when the job is to avoid unintended changes immediately after importing a remote object, whereas the current scenario requires the engineer to associate one existing remote object with a configured resource address. These operations have different effects in the stated Terraform workflow.
C:Generated resource declarations are a starting point and can include computed or unsuitable attributes requiring manual cleanup; this mechanism is useful when the job is to correct provider-generated HCL rather than trusting every inferred argument, whereas the current scenario requires the engineer to associate one existing remote object with a configured resource address. These operations have different effects in the stated Terraform workflow.
D:The experimental config-generation flag can write suggested resource declarations for review and correction before apply; this mechanism is useful when the job is to produce draft HCL for resources named in import blocks without matching configuration, whereas the current scenario requires the engineer to associate one existing remote object with a configured resource address. These operations have different effects in the stated Terraform workflow.
Question 1066
During a design review, the requirement is to refer to shared infrastructure that another stack owns without changing its lifecycle. Which option should the engineer select?
- A normal plan with drift
- A data source instead of import
- terraform apply -refresh-only
- A refreshed changed resource
Explanation
Correct Answer
B:A data block can read an external object's attributes while avoiding taking over its create-update-delete lifecycle; this directly meets the requirement to refer to shared infrastructure that another stack owns without changing its lifecycle. By comparison, a normal plan with drift is intended to detect and propose correction for changes made outside Terraform, which is a different task from refer to shared infrastructure that another stack owns without changing its lifecycle.
Incorrect Answers
A:Providers refresh remote resource attributes, and planning can propose updates to bring changed objects back to declared configuration; this mechanism is useful when the job is to detect and propose correction for changes made outside Terraform, whereas the current scenario requires the engineer to refer to shared infrastructure that another stack owns without changing its lifecycle. These operations have different effects in the stated Terraform workflow.
C:Refresh-only apply can update the recorded state to match observed remote attributes without modifying cloud resources; this mechanism is useful when the job is to accept current remote readings into Terraform's state through an apply operation, whereas the current scenario requires the engineer to refer to shared infrastructure that another stack owns without changing its lifecycle. These operations have different effects in the stated Terraform workflow.
D:Configuration still describes the preferred value, so normal planning can propose undoing an out-of-band modification unless ignored; this mechanism is useful when the job is to understand why Terraform tries to reset a manually edited resource attribute, whereas the current scenario requires the engineer to refer to shared infrastructure that another stack owns without changing its lifecycle. These operations have different effects in the stated Terraform workflow.
Question 1067
A team compares Terraform mechanisms for the goal to associate arbitrary string keys with string values. Which stated consequence belongs specifically to “A map of strings type”?
- The optional type modifier inside an object constraint allows the caller to omit a field and optionally sets a default.
- Keyed for_each instances use stable identifiers, whereas count indexes can shift when list elements are deleted.
- The map(string) type models uniform values accessed by key rather than by positional index.
- tolist converts compatible values to a list, but a source set's original order is not inherently meaningful.
Explanation
Correct Answer
C:The named mechanism is used when the objective is to associate arbitrary string keys with string values, so it produces the behavior described. In contrast, an optional object attribute serves a different goal: accept an omitted field in a structured object input, not associate arbitrary string keys with string values.
Incorrect Answers
A:The description applies to an optional object attribute when an engineer needs to accept an omitted field in a structured object input; the named a map of strings type instead handles the requirement to associate arbitrary string keys with string values, so this behavior does not describe A map of strings type in the situation named.
B:The description applies to avoiding index churn with for_each when an engineer needs to preserve instance identity when a middle collection item is removed; the named a map of strings type instead handles the requirement to associate arbitrary string keys with string values, so this behavior does not describe A map of strings type in the situation named.
D:The description applies to tolist conversion when an engineer needs to coerce a suitable collection into a list for ordered operations; the named a map of strings type instead handles the requirement to associate arbitrary string keys with string values, so this behavior does not describe A map of strings type in the situation named.
Question 1068
The team evaluates “A local state backup file” for a requirement to recover from a state change without relying solely on an unversioned primary file. Which observed behavior belongs to that mechanism rather than a different Terraform feature?
- Terraform commonly writes backup snapshots for local state updates, but backups require the same confidentiality controls as state.
- The local backend supports a path argument for where the state file is stored on disk.
- Changing the root backend and running init -migrate-state can transfer the existing snapshot to the newly configured destination.
- A temporary runner may lose its filesystem after a job, so durable shared state is usually needed for repeatable team automation.
- Local state can hold raw provider attributes and secrets, so filesystem access controls and encryption matter.
Explanation
Correct Answer
A:The named mechanism is used when the objective is to recover from a state change without relying solely on an unversioned primary file, so it produces the behavior described. In contrast, a local backend path setting serves a different goal: save the default workspace state to a nondefault local filename, not recover from a state change without relying solely on an unversioned primary file.
Incorrect Answers
B:The description applies to a local backend path setting when an engineer needs to save the default workspace state to a nondefault local filename; the named a local state backup file instead handles the requirement to recover from a state change without relying solely on an unversioned primary file, so this behavior does not describe A local state backup file in the situation named.
C:The description applies to state migration from local storage when an engineer needs to move an established project to remote state without abandoning resource identity; the named a local state backup file instead handles the requirement to recover from a state change without relying solely on an unversioned primary file, so this behavior does not describe A local state backup file in the situation named.
D:The description applies to local state in CI when an engineer needs to recognize why ephemeral build agents should not rely on a machine-local state file; the named a local state backup file instead handles the requirement to recover from a state change without relying solely on an unversioned primary file, so this behavior does not describe A local state backup file in the situation named.
E:The description applies to state file confidentiality when an engineer needs to protect a workstation's local state file even when output values are hidden; the named a local state backup file instead handles the requirement to recover from a state change without relying solely on an unversioned primary file, so this behavior does not describe A local state backup file in the situation named.
Question 1069
A team compares Terraform mechanisms for the goal to list the workspaces available through the initialized backend. Which stated consequence belongs specifically to “terraform workspace list”?
- Workspace list shows logical Terraform workspaces, which may correspond to separate state instances depending on backend support.
- The show command renders state or plan content without being an apply operation.
- The providers command displays provider requirements and their module relationships for dependency troubleshooting.
- Replace-provider rewrites provider source references in state and creates a backup before the edit.
Explanation
Correct Answer
A:The named mechanism is used when the objective is to list the workspaces available through the initialized backend, so it produces the behavior described. In contrast, terraform providers serves a different goal: inspect which providers the current configuration requires, not list the workspaces available through the initialized backend.
Incorrect Answers
B:The description applies to terraform show when an engineer needs to display the current state or a saved plan in a human-readable way; the named terraform workspace list instead handles the requirement to list the workspaces available through the initialized backend, so this behavior does not describe terraform workspace list in the situation named.
C:The description applies to terraform providers when an engineer needs to inspect which providers the current configuration requires; the named terraform workspace list instead handles the requirement to list the workspaces available through the initialized backend, so this behavior does not describe terraform workspace list in the situation named.
D:The description applies to terraform state replace-provider when an engineer needs to update the provider source address recorded for affected state resources; the named terraform workspace list instead handles the requirement to list the workspaces available through the initialized backend, so this behavior does not describe terraform workspace list in the situation named.
Question 1070
An engineer intends to publish selected values produced by an HCP Terraform run and is reviewing “Workspace outputs”. What consequence follows from using it as intended?
- Queued runs and workspace run management help serialize changes and avoid competing applies to one state.
- HCP Terraform maintains workspace state versions and supports collaboration without exposing a machine-local canonical state file.
- HCP Terraform can connect a workspace to a VCS repository and create runs when relevant commits are pushed.
- Workspace output values come from root module output blocks and can be consumed through supported interfaces.
- An HCP Terraform workspace organizes its own state and runs, providing a collaboration boundary for Terraform execution.
Explanation
Correct Answer
D:The named mechanism is used when the objective is to publish selected values produced by an HCP Terraform run, so it produces the behavior described. In contrast, the HCP run queue serves a different goal: coordinate multiple requested changes against the same workspace state, not publish selected values produced by an HCP Terraform run.
Incorrect Answers
A:The description applies to the HCP run queue when an engineer needs to coordinate multiple requested changes against the same workspace state; the named workspace outputs instead handles the requirement to publish selected values produced by an HCP Terraform run, so this behavior does not describe Workspace outputs in the situation named.
B:The description applies to HCP Terraform remote state when an engineer needs to store Terraform state under managed service controls rather than a local file; the named workspace outputs instead handles the requirement to publish selected values produced by an HCP Terraform run, so this behavior does not describe Workspace outputs in the situation named.
C:The description applies to a VCS-connected workspace when an engineer needs to trigger infrastructure runs from changes in a configured version-control repository; the named workspace outputs instead handles the requirement to publish selected values produced by an HCP Terraform run, so this behavior does not describe Workspace outputs in the situation named.
E:The description applies to an HCP Terraform workspace when an engineer needs to associate configuration, variables, state and runs for one managed infrastructure scope; the named workspace outputs instead handles the requirement to publish selected values produced by an HCP Terraform run, so this behavior does not describe Workspace outputs in the situation named.