Question 990
The team evaluates “depends_on for module calls” for a requirement to wait for prerequisite objects before considering resources in another module. Which observed behavior belongs to that mechanism rather than a different Terraform feature?
- A module block can declare depends_on so all managed objects inside it observe the specified dependency relationship.
- The -target option narrows an operation to selected objects and prerequisites; routine selective deployment is not its intended model.
- The lifecycle ignore_changes list excludes chosen attributes from later update comparisons while creation still considers configured values.
- With all attributes ignored during updates, Terraform can still create and destroy the resource but does not reconcile field-level changes.
- This lifecycle rule uses planned resource actions as triggers for replacement and is not a general-purpose dependency selector.
Explanation
Correct Answer
A:The named mechanism is used when the objective is to wait for prerequisite objects before considering resources in another module, so it produces the behavior described. In contrast, ignore_changes = all serves a different goal: disable updates to all managed resource attributes after creation, not wait for prerequisite objects before considering resources in another module.
Incorrect Answers
B:The description applies to resource targeting as an exception when an engineer needs to repair an isolated broken dependency while acknowledging incomplete plan coverage; the named depends_on for module calls instead handles the requirement to wait for prerequisite objects before considering resources in another module, so this behavior does not describe depends_on for module calls in the situation named.
C:The description applies to ignore_changes on a tag when an engineer needs to allow another system to update selected attributes without Terraform reverting them; the named depends_on for module calls instead handles the requirement to wait for prerequisite objects before considering resources in another module, so this behavior does not describe depends_on for module calls in the situation named.
D:The description applies to ignore_changes = all when an engineer needs to disable updates to all managed resource attributes after creation; the named depends_on for module calls instead handles the requirement to wait for prerequisite objects before considering resources in another module, so this behavior does not describe depends_on for module calls in the situation named.
E:The description applies to replace_triggered_by when an engineer needs to replace one managed resource when another managed resource's attribute changes; the named depends_on for module calls instead handles the requirement to wait for prerequisite objects before considering resources in another module, so this behavior does not describe depends_on for module calls in the situation named.
Question 991
A Terraform reviewer encounters “Repeatable environment definition” while assessing how to recreate the same logical infrastructure design across test and production. Which statement correctly describes its actual behavior?
- Terraform state records mappings and attributes needed to compare future plans without rediscovering every object's identity from scratch.
- IaC configuration provides repeatable definitions; variables and isolated state allow environments to differ without independently hand-building each object.
- Terraform interprets resource declarations, constructs a dependency graph, and asks providers to reconcile real objects with that desired state.
- Terraform reads .tf files written in HCL, including blocks, arguments, expressions and references that describe the intended objects.
Explanation
Correct Answer
B:The named mechanism is used when the objective is to recreate the same logical infrastructure design across test and production, so it produces the behavior described. In contrast, state-backed object tracking serves a different goal: retain the association between a configuration address and its actual managed object, not recreate the same logical infrastructure design across test and production.
Incorrect Answers
A:The description applies to state-backed object tracking when an engineer needs to retain the association between a configuration address and its actual managed object; the named repeatable environment definition instead handles the requirement to recreate the same logical infrastructure design across test and production, so this behavior does not describe Repeatable environment definition in the situation named.
C:The description applies to declarative resource configuration when an engineer needs to describe the desired infrastructure state instead of scripting every API step; the named repeatable environment definition instead handles the requirement to recreate the same logical infrastructure design across test and production, so this behavior does not describe Repeatable environment definition in the situation named.
D:The description applies to HCL configuration files when an engineer needs to represent managed infrastructure using Terraform's native declarative language; the named repeatable environment definition instead handles the requirement to recreate the same logical infrastructure design across test and production, so this behavior does not describe Repeatable environment definition in the situation named.
Question 992
A team compares Terraform mechanisms for the goal to move existing state to a newly configured backend. Which stated consequence belongs specifically to “terraform init -migrate-state”?
- The migrate-state flag attempts to copy prior state into the new backend and can prompt for migration confirmation.
- Terraform records provider version and checksum selections in its dependency lock file, which teams normally commit to source control.
- A modified provider requirement can trigger a need to rerun init to resolve the newly declared plugin dependency.
- The backend=false switch suppresses backend setup; commands needing backend access may then be unable to proceed.
Explanation
Correct Answer
A:The named mechanism is used when the objective is to move existing state to a newly configured backend, so it produces the behavior described. In contrast, terraform init -backend=false serves a different goal: skip backend initialization during a specialized init operation, not move existing state to a newly configured backend.
Incorrect Answers
B:The description applies to the .terraform.lock.hcl file when an engineer needs to identify which file should be checked in to preserve selected provider packages; the named terraform init -migrate-state instead handles the requirement to move existing state to a newly configured backend, so this behavior does not describe terraform init -migrate-state in the situation named.
C:The description applies to provider source change reinitialization when an engineer needs to respond after changing the source address of a required provider; the named terraform init -migrate-state instead handles the requirement to move existing state to a newly configured backend, so this behavior does not describe terraform init -migrate-state in the situation named.
D:The description applies to terraform init -backend=false when an engineer needs to skip backend initialization during a specialized init operation; the named terraform init -migrate-state instead handles the requirement to move existing state to a newly configured backend, so this behavior does not describe terraform init -migrate-state in the situation named.
Question 993
A Terraform change proposal names “Root input variable scope” to read command-line and tfvars input values for the root module. Which outcome can reviewers attribute to that particular mechanism?
- A child output can be marked sensitive, but its underlying value may still reside in state unless it uses permitted ephemeral handling.
- Root variables accept runtime assignments, whereas a child module normally receives its inputs through the parent's module call.
- An object type lets a module enforce named configuration fields instead of accepting many untyped values.
- A module block explicitly sets the child's declared input variables using arguments of matching names.
Explanation
Correct Answer
B:The named mechanism is used when the objective is to read command-line and tfvars input values for the root module, so it produces the behavior described. In contrast, parent-to-child argument passing serves a different goal: set a reusable module's environment tag from the caller, not read command-line and tfvars input values for the root module.
Incorrect Answers
A:The description applies to child module outputs and sensitivity when an engineer needs to limit ordinary display of a sensitive result exported from a reusable module; the named root input variable scope instead handles the requirement to read command-line and tfvars input values for the root module, so this behavior does not describe Root input variable scope in the situation named.
C:The description applies to input object variables when an engineer needs to pass a structured settings bundle into a reusable module; the named root input variable scope instead handles the requirement to read command-line and tfvars input values for the root module, so this behavior does not describe Root input variable scope in the situation named.
D:The description applies to parent-to-child argument passing when an engineer needs to set a reusable module's environment tag from the caller; the named root input variable scope instead handles the requirement to read command-line and tfvars input values for the root module, so this behavior does not describe Root input variable scope in the situation named.
Question 994
A declarative resource and expression design needs to avoid exposing a secret in ordinary workspace variable screens and logs. Which feature or operation is the most direct match?
- HCP Terraform sensitive workspace variables
- An ephemeral child module output
- Vault short-lived credentials
- Remote state access controls
Explanation
Correct Answer
A:HCP Terraform can mark workspace variables sensitive to limit UI exposure, though sensitive flags do not replace secure state access; this directly meets the requirement to avoid exposing a secret in ordinary workspace variable screens and logs. By comparison, remote state access controls is intended to prevent unauthorized operators from reading sensitive resource attributes, which is a different task from avoid exposing a secret in ordinary workspace variable screens and logs.
Incorrect Answers
B:Ephemeral outputs are permitted on child modules, allowing a value to travel through an allowed ephemeral context without entering state; this mechanism is useful when the job is to pass a temporary sensitive value from a child module to its parent, whereas the current scenario requires the engineer to avoid exposing a secret in ordinary workspace variable screens and logs. These operations have different effects in the stated Terraform workflow.
C:Vault's dynamic credentials can provide expiring access with centrally enforced policies instead of permanent embedded keys; this mechanism is useful when the job is to limit the lifetime and scope of identities used by infrastructure automation, whereas the current scenario requires the engineer to avoid exposing a secret in ordinary workspace variable screens and logs. These operations have different effects in the stated Terraform workflow.
D:Protecting state requires backend encryption, identity-based authorization and controlled access because state can store raw secret values; this mechanism is useful when the job is to prevent unauthorized operators from reading sensitive resource attributes, whereas the current scenario requires the engineer to avoid exposing a secret in ordinary workspace variable screens and logs. These operations have different effects in the stated Terraform workflow.
Question 995
During a design review, the requirement is to understand why Terraform proposes creating a managed object deleted outside the workflow. Which option should the engineer select?
- A refreshed missing resource
- A normal plan with drift
- Serial and lineage checks
- A data source instead of import
- A state import workflow
Explanation
Correct Answer
A:If a provider reports a tracked object no longer exists, a normal plan generally proposes recreating it when its resource block remains; this directly meets the requirement to understand why Terraform proposes creating a managed object deleted outside the workflow. By comparison, serial and lineage checks is intended to detect that a state snapshot belongs to a different history or older generation, which is a different task from understand why Terraform proposes creating a managed object deleted outside the workflow.
Incorrect Answers
B: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 understand why Terraform proposes creating a managed object deleted outside the workflow. These operations have different effects in the stated Terraform workflow.
C:State metadata such as lineage and serial helps protect against incompatible or stale state updates; this mechanism is useful when the job is to detect that a state snapshot belongs to a different history or older generation, whereas the current scenario requires the engineer to understand why Terraform proposes creating a managed object deleted outside the workflow. These operations have different effects in the stated Terraform workflow.
D:A data block can read an external object's attributes while avoiding taking over its create-update-delete lifecycle; this mechanism is useful when the job is to refer to shared infrastructure that another stack owns without changing its lifecycle, whereas the current scenario requires the engineer to understand why Terraform proposes creating a managed object deleted outside the workflow. These operations have different effects in the stated Terraform workflow.
E:Importing attaches the remote object's identity to state; compatible configuration is still needed to avoid unwanted changes afterward; this mechanism is useful when the job is to associate existing infrastructure with a newly declared Terraform resource address, whereas the current scenario requires the engineer to understand why Terraform proposes creating a managed object deleted outside the workflow. These operations have different effects in the stated Terraform workflow.
Question 996
An engineering checklist calls for separate outcomes: (1) move an established project to remote state without abandoning resource identity; (2) enforce read and write privileges on the state object; (3) obtain the current state snapshot for inspection or controlled backup. Which THREE options implement the requested outcomes? Choose THREE.
- An HCP Terraform cloud block
- terraform plan -refresh-only
- terraform state pull
- Backend configuration only in a root module
- State migration from local storage
- Remote backend access permissions
Explanation
Correct Answers
C:The state pull command retrieves state from the configured backend and prints a snapshot that may contain secrets; this meets the requirement to obtain the current state snapshot for inspection or controlled backup, while the other selected techniques address move an established project to remote state without abandoning resource identity and enforce read and write privileges on the state object, which require their own distinct Terraform mechanisms.
E:Changing the root backend and running init -migrate-state can transfer the existing snapshot to the newly configured destination; this meets the requirement to move an established project to remote state without abandoning resource identity, while the other selected techniques address enforce read and write privileges on the state object and obtain the current state snapshot for inspection or controlled backup, which require their own distinct Terraform mechanisms.
F:Cloud storage policy and backend authorization decide who can obtain or mutate stored Terraform state; provider credentials alone are not sufficient; this meets the requirement to enforce read and write privileges on the state object, while the other selected techniques address move an established project to remote state without abandoning resource identity and obtain the current state snapshot for inspection or controlled backup, which require their own distinct Terraform mechanisms.
Incorrect Answers
A:The terraform cloud block connects configuration to HCP Terraform, and cannot coexist with a standard backend block in the same configuration; it addresses integrate Terraform CLI with an HCP organization and workspace, but this delivery instead requires move an established project to remote state without abandoning resource identity and enforce read and write privileges on the state object and obtain the current state snapshot for inspection or controlled backup. The required combination involves State migration from local storage and Remote backend access permissions and terraform state pull, not the behavior of An HCP Terraform cloud block.
B:Refresh-only planning previews proposed updates to state or root outputs without committing those updates; an apply is needed to persist them; it addresses preview proposed state-only changes without changing remote objects or committing new state, but this delivery instead requires move an established project to remote state without abandoning resource identity and enforce read and write privileges on the state object and obtain the current state snapshot for inspection or controlled backup. The required combination involves State migration from local storage and Remote backend access permissions and terraform state pull, not the behavior of terraform plan -refresh-only.
D:Backend configuration is evaluated for the root module; defining backend settings inside reusable child modules does not give them separate state; it addresses choose where a root deployment's state will be stored, but this delivery instead requires move an established project to remote state without abandoning resource identity and enforce read and write privileges on the state object and obtain the current state snapshot for inspection or controlled backup. The required combination involves State migration from local storage and Remote backend access permissions and terraform state pull, not the behavior of Backend configuration only in a root module.
Question 997
A platform engineering team maintaining plugins requires a way to avoid exposing full state when another stack only needs a published identifier. Which Terraform approach most directly fulfills that request?
- Remote state sharing boundaries
- The state serial number
- State-backed dependency links
- State access protection
- State snapshots
Explanation
Correct Answer
A:Reading a remote state output still requires access to the underlying snapshot; exporting data through a narrower interface can reduce exposure; this directly meets the requirement to avoid exposing full state when another stack only needs a published identifier. By comparison, the state serial number is intended to understand how successive snapshots are ordered, which is a different task from avoid exposing full state when another stack only needs a published identifier.
Incorrect Answers
B:State metadata includes lineage and serial information that helps Terraform identify state history and updates; this mechanism is useful when the job is to understand how successive snapshots are ordered, whereas the current scenario requires the engineer to avoid exposing full state when another stack only needs a published identifier. These operations have different effects in the stated Terraform workflow.
C:State can retain dependency information needed to correctly destroy objects no longer declared in configuration; this mechanism is useful when the job is to maintain dependencies for resources that have been removed from configuration, whereas the current scenario requires the engineer to avoid exposing full state when another stack only needs a published identifier. These operations have different effects in the stated Terraform workflow.
D:State may contain secret values even when CLI output is redacted, so storage encryption and access controls matter; this mechanism is useful when the job is to treat a Terraform state file as potentially sensitive data, whereas the current scenario requires the engineer to avoid exposing full state when another stack only needs a published identifier. These operations have different effects in the stated Terraform workflow.
E:The state snapshot records managed instance data and metadata needed to plan future actions; this mechanism is useful when the job is to preserve Terraform's knowledge of managed infrastructure between CLI runs, whereas the current scenario requires the engineer to avoid exposing full state when another stack only needs a published identifier. These operations have different effects in the stated Terraform workflow.
Question 998
A Terraform module author requires a way to delay a lookup until a prerequisite object is available. Which Terraform approach most directly fulfills that request?
- Removing a resource declaration
- Importing an existing object
- A data source that depends on a resource
- The terraform_data resource
Explanation
Correct Answer
C:Data source reads can be deferred during planning when their inputs depend on values not known until apply; this directly meets the requirement to delay a lookup until a prerequisite object is available. By comparison, removing a resource declaration is intended to plan to delete a previously managed object that remains in state, which is a different task from delay a lookup until a prerequisite object is available.
Incorrect Answers
A:When a managed resource is absent from configuration but still tracked in state, normal planning proposes its destruction; this mechanism is useful when the job is to plan to delete a previously managed object that remains in state, whereas the current scenario requires the engineer to delay a lookup until a prerequisite object is available. These operations have different effects in the stated Terraform workflow.
B:Import associates a configured resource address with an existing remote object's provider identity in Terraform state; this mechanism is useful when the job is to bring a previously unmanaged remote object under a resource block's lifecycle, whereas the current scenario requires the engineer to delay a lookup until a prerequisite object is available. These operations have different effects in the stated Terraform workflow.
D:The built-in terraform_data resource can represent input changes and trigger replacement behavior without managing a cloud API resource; this mechanism is useful when the job is to model a Terraform-managed lifecycle value without requiring an external service object, whereas the current scenario requires the engineer to delay a lookup until a prerequisite object is available. These operations have different effects in the stated Terraform workflow.
Question 999
A Terraform reviewer encounters “Iterate after feedback” while assessing how to modify and re-plan after a change request is rejected. Which statement correctly describes its actual behavior?
- Following apply, output values and state inspection can reveal created identifiers while a new plan can test for remaining drift.
- A revised configuration must be planned again because a prior plan does not automatically incorporate later edits.
- The workflow begins by declaring resources, inputs and dependencies that describe what Terraform should manage.
- Running terraform init configures backend access, child modules and required providers before plans can run.
Explanation
Correct Answer
B:The named mechanism is used when the objective is to modify and re-plan after a change request is rejected, so it produces the behavior described. In contrast, initialize after checkout serves a different goal: prepare a newly cloned root module for local Terraform operations, not modify and re-plan after a change request is rejected.
Incorrect Answers
A:The description applies to check infrastructure after apply when an engineer needs to confirm deployed outputs and state match the expected result; the named iterate after feedback instead handles the requirement to modify and re-plan after a change request is rejected, so this behavior does not describe Iterate after feedback in the situation named.
C:The description applies to write configuration first when an engineer needs to express the intended infrastructure before asking Terraform for a plan; the named iterate after feedback instead handles the requirement to modify and re-plan after a change request is rejected, so this behavior does not describe Iterate after feedback in the situation named.
D:The description applies to initialize after checkout when an engineer needs to prepare a newly cloned root module for local Terraform operations; the named iterate after feedback instead handles the requirement to modify and re-plan after a change request is rejected, so this behavior does not describe Iterate after feedback in the situation named.
Question 1000
A change-control meeting for a root module has a concrete implementation goal: execute a destroy-mode apply within a controlled workflow. What is the most appropriate Terraform mechanism?
- terraform apply -destroy
- Resource-specific delete restrictions
- terraform plan -destroy
- Remove from state without deletion
- terraform destroy
- Destroy plan risk review
Explanation
Correct Answer
A:The destroy mode tells apply to plan removal of managed resources rather than ordinary convergence to resource declarations; this directly meets the requirement to execute a destroy-mode apply within a controlled workflow. By comparison, remove from state without deletion is intended to stop managing an existing object while preserving the real remote infrastructure, which is a different task from execute a destroy-mode apply within a controlled workflow.
Incorrect Answers
B:Providers and remote APIs can reject deletion when dependencies, protection flags or permissions prevent removing the object; this mechanism is useful when the job is to diagnose why destroy fails despite valid Terraform syntax, whereas the current scenario requires the engineer to execute a destroy-mode apply within a controlled workflow. These operations have different effects in the stated Terraform workflow.
C:Destroy planning shows the deletion proposal without carrying out the deletion until apply; this mechanism is useful when the job is to review an all-destroy plan before approving resource deletion, whereas the current scenario requires the engineer to execute a destroy-mode apply within a controlled workflow. These operations have different effects in the stated Terraform workflow.
D:Removing a state association, for example with terraform state rm, makes Terraform forget the object without asking the provider to delete it; this mechanism is useful when the job is to stop managing an existing object while preserving the real remote infrastructure, whereas the current scenario requires the engineer to execute a destroy-mode apply within a controlled workflow. These operations have different effects in the stated Terraform workflow.
E:The destroy command plans and applies removal of managed objects subject to lifecycle and provider constraints; this mechanism is useful when the job is to remove the managed infrastructure described by the current Terraform configuration, whereas the current scenario requires the engineer to execute a destroy-mode apply within a controlled workflow. These operations have different effects in the stated Terraform workflow.
F:Reviewing a destroy plan is essential because a command can remove every managed instance within the relevant state scope; this mechanism is useful when the job is to identify which root-module-managed resources will be affected before a cleanup, whereas the current scenario requires the engineer to execute a destroy-mode apply within a controlled workflow. These operations have different effects in the stated Terraform workflow.