Question 940
A Terraform reviewer encounters “Local workspace state directories” while assessing how to identify how the local backend stores nondefault workspaces. Which statement correctly describes its actual behavior?
- Terraform commonly writes backup snapshots for local state updates, but backups require the same confidentiality controls as state.
- Backend configuration is evaluated for the root module; defining backend settings inside reusable child modules does not give them separate state.
- Local state can hold raw provider attributes and secrets, so filesystem access controls and encryption matter.
- When local workspaces are used, nondefault state snapshots are placed under a terraform.tfstate.d directory structure.
Explanation
Correct Answer
D:The named mechanism is used when the objective is to identify how the local backend stores nondefault workspaces, so it produces the behavior described. In contrast, a local state backup file serves a different goal: recover from a state change without relying solely on an unversioned primary file, not identify how the local backend stores nondefault workspaces.
Incorrect Answers
A:The description applies to a local state backup file when an engineer needs to recover from a state change without relying solely on an unversioned primary file; the named local workspace state directories instead handles the requirement to identify how the local backend stores nondefault workspaces, so this behavior does not describe Local workspace state directories in the situation named.
B:The description applies to backend configuration only in a root module when an engineer needs to choose where a root deployment's state will be stored; the named local workspace state directories instead handles the requirement to identify how the local backend stores nondefault workspaces, so this behavior does not describe Local workspace state directories in the situation named.
C: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 local workspace state directories instead handles the requirement to identify how the local backend stores nondefault workspaces, so this behavior does not describe Local workspace state directories in the situation named.
Question 941
A pipeline responsible for the Terraform workflow requires a way to inspect the human-readable contents of a saved Terraform plan. Which Terraform approach most directly fulfills that request?
- A resource action marked minus
- A resource action marked plus
- terraform graph
- An unknown value until apply
- The dependency graph during planning
- terraform show on a plan file
Explanation
Correct Answer
F:terraform show can display a saved plan's actions and attributes; sensitive material may appear in machine-readable forms; this directly meets the requirement to inspect the human-readable contents of a saved Terraform plan. By comparison, the dependency graph during planning is intended to explain why two unrelated resources can be planned and applied in parallel, which is a different task from inspect the human-readable contents of a saved Terraform plan.
Incorrect Answers
A: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 inspect the human-readable contents of a saved Terraform plan. 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 inspect the human-readable contents of a saved Terraform plan. These operations have different effects in the stated Terraform workflow.
C:The graph command emits a DOT graph representation of Terraform dependencies, useful for spotting unexpected ordering constraints; this mechanism is useful when the job is to display configuration and state dependencies for troubleshooting, whereas the current scenario requires the engineer to inspect the human-readable contents of a saved Terraform plan. These operations have different effects in the stated Terraform workflow.
D: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 inspect the human-readable contents of a saved Terraform plan. These operations have different effects in the stated Terraform workflow.
E: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 inspect the human-readable contents of a saved Terraform plan. These operations have different effects in the stated Terraform workflow.
Question 942
During a design review, the requirement is to prevent unauthorized operators from reading sensitive resource attributes. Which option should the engineer select?
- ephemeral = true on a variable
- An ephemeral resource block
- Remote state access controls
- Vault-backed secret retrieval
Explanation
Correct Answer
C:Protecting state requires backend encryption, identity-based authorization and controlled access because state can store raw secret values; this directly meets the requirement to prevent unauthorized operators from reading sensitive resource attributes. By comparison, vault-backed secret retrieval is intended to retrieve an operational credential from a dedicated secret manager rather than committing it, which is a different task from prevent unauthorized operators from reading sensitive resource attributes.
Incorrect Answers
A:Terraform 1.10+ ephemeral variables can flow only into allowed ephemeral contexts and are omitted from persisted artifacts; this mechanism is useful when the job is to use a short-lived runtime secret without saving its value in plan or state, whereas the current scenario requires the engineer to prevent unauthorized operators from reading sensitive resource attributes. These operations have different effects in the stated Terraform workflow.
B:Provider-supported ephemeral resources exist only during an operation and can feed appropriate ephemeral consumers; this mechanism is useful when the job is to retrieve or generate temporary data that should not be persisted in Terraform state, whereas the current scenario requires the engineer to prevent unauthorized operators from reading sensitive resource attributes. These operations have different effects in the stated Terraform workflow.
D:Vault can centralize secret lifecycle, policies and auditability, but provider and state-handling choices still determine whether a retrieved value is persisted; this mechanism is useful when the job is to retrieve an operational credential from a dedicated secret manager rather than committing it, whereas the current scenario requires the engineer to prevent unauthorized operators from reading sensitive resource attributes. These operations have different effects in the stated Terraform workflow.
Question 943
A change request asks an engineer to select workspaces using Terraform cloud configuration rather than a single explicit name. Which choice best implements the requested behavior?
- One state per independently owned system
- A tagged cloud workspaces block
- Workspace-specific variables
- Project-scoped team access
Explanation
Correct Answer
B:The cloud block can select a workspace set by supported tags, which differs from specifying one workspace name; this directly meets the requirement to select workspaces using Terraform cloud configuration rather than a single explicit name. By comparison, workspace-specific variables is intended to override or tailor values used by one particular stack, which is a different task from select workspaces using Terraform cloud configuration rather than a single explicit name.
Incorrect Answers
A:Separate workspaces allow independent state lifecycles for services that are changed and approved separately; this mechanism is useful when the job is to avoid coupling different teams' deploys into a single state and blast radius, whereas the current scenario requires the engineer to select workspaces using Terraform cloud configuration rather than a single explicit name. These operations have different effects in the stated Terraform workflow.
C:Workspace settings store variables for that workspace's execution; global sets should not replace environment-specific data blindly; this mechanism is useful when the job is to override or tailor values used by one particular stack, whereas the current scenario requires the engineer to select workspaces using Terraform cloud configuration rather than a single explicit name. These operations have different effects in the stated Terraform workflow.
D:Project-level access scopes workspace capabilities for teams based on organizational boundaries; this mechanism is useful when the job is to delegate administration of one team's project without granting universal organization access, whereas the current scenario requires the engineer to select workspaces using Terraform cloud configuration rather than a single explicit name. These operations have different effects in the stated Terraform workflow.
Question 944
A platform team separating infrastructure deployments requires a way to avoid coupling different teams' deploys into a single state and blast radius. Which Terraform approach most directly fulfills that request?
- A tagged cloud workspaces block
- One state per independently owned system
- Workspace-specific variables
- An HCP Terraform project
- Variable sets scoped to workspaces
- Project-level variable sets
Explanation
Correct Answer
B:Separate workspaces allow independent state lifecycles for services that are changed and approved separately; this directly meets the requirement to avoid coupling different teams' deploys into a single state and blast radius. By comparison, a tagged cloud workspaces block is intended to select workspaces using Terraform cloud configuration rather than a single explicit name, which is a different task from avoid coupling different teams' deploys into a single state and blast radius.
Incorrect Answers
A:The cloud block can select a workspace set by supported tags, which differs from specifying one workspace name; this mechanism is useful when the job is to select workspaces using Terraform cloud configuration rather than a single explicit name, whereas the current scenario requires the engineer to avoid coupling different teams' deploys into a single state and blast radius. These operations have different effects in the stated Terraform workflow.
C:Workspace settings store variables for that workspace's execution; global sets should not replace environment-specific data blindly; this mechanism is useful when the job is to override or tailor values used by one particular stack, whereas the current scenario requires the engineer to avoid coupling different teams' deploys into a single state and blast radius. These operations have different effects in the stated Terraform workflow.
D:Projects organize workspaces by application, team or environment, simplifying scope and access administration; this mechanism is useful when the job is to group related workspaces under one organizational and permissions boundary, whereas the current scenario requires the engineer to avoid coupling different teams' deploys into a single state and blast radius. These operations have different effects in the stated Terraform workflow.
E:A variable set may apply to selected workspaces instead of every workspace in an organization; this mechanism is useful when the job is to share credentials only with selected approved infrastructure scopes, whereas the current scenario requires the engineer to avoid coupling different teams' deploys into a single state and blast radius. These operations have different effects in the stated Terraform workflow.
F:Variable sets can be scoped to projects to share configuration while avoiding repetitive per-workspace assignments; this mechanism is useful when the job is to assign common environment values to a group of workspaces, whereas the current scenario requires the engineer to avoid coupling different teams' deploys into a single state and blast radius. These operations have different effects in the stated Terraform workflow.
Question 945
A Terraform deployment has independent requirements: (1) identify a computed attribute that Terraform cannot determine until apply; (2) define a specific boolean statement for a nonblocking Terraform health check; (3) avoid putting provider access tokens directly in configuration source. Which THREE mechanisms directly address these needs? Choose THREE.
- A write-only argument version field
- An unknown plan-time value
- Avoiding index churn with for_each
- Resource precondition
- An assert block inside check
- Environment-based provider credentials
Explanation
Correct Answers
B:An unknown value represents future information and can propagate through expressions until a provider supplies the result; this meets the requirement to identify a computed attribute that Terraform cannot determine until apply, while the other selected techniques address define a specific boolean statement for a nonblocking Terraform health check and avoid putting provider access tokens directly in configuration source, which require their own distinct Terraform mechanisms.
E:Check blocks contain assert blocks with condition and error_message to describe an unsuccessful assertion; this meets the requirement to define a specific boolean statement for a nonblocking Terraform health check, while the other selected techniques address identify a computed attribute that Terraform cannot determine until apply and avoid putting provider access tokens directly in configuration source, which require their own distinct Terraform mechanisms.
F:Providers can often authenticate through environment variables or identity integrations so credentials are absent from checked-in HCL; this meets the requirement to avoid putting provider access tokens directly in configuration source, while the other selected techniques address identify a computed attribute that Terraform cannot determine until apply and define a specific boolean statement for a nonblocking Terraform health check, which require their own distinct Terraform mechanisms.
Incorrect Answers
A:Some write-only provider arguments expose an accompanying nonsecret version marker that triggers a new operation when incremented; it addresses force an update when a write-only secret changes without exposing the secret itself, but this delivery instead requires identify a computed attribute that Terraform cannot determine until apply and define a specific boolean statement for a nonblocking Terraform health check and avoid putting provider access tokens directly in configuration source. The required combination involves An unknown plan-time value and An assert block inside check and Environment-based provider credentials, not the behavior of A write-only argument version field.
C:Keyed for_each instances use stable identifiers, whereas count indexes can shift when list elements are deleted; it addresses preserve instance identity when a middle collection item is removed, but this delivery instead requires identify a computed attribute that Terraform cannot determine until apply and define a specific boolean statement for a nonblocking Terraform health check and avoid putting provider access tokens directly in configuration source. The required combination involves An unknown plan-time value and An assert block inside check and Environment-based provider credentials, not the behavior of Avoiding index churn with for_each.
D:A precondition inside lifecycle requires a true predicate before Terraform can continue the relevant resource operation; it addresses fail a plan or apply when a prerequisite property is unacceptable, but this delivery instead requires identify a computed attribute that Terraform cannot determine until apply and define a specific boolean statement for a nonblocking Terraform health check and avoid putting provider access tokens directly in configuration source. The required combination involves An unknown plan-time value and An assert block inside check and Environment-based provider credentials, not the behavior of Resource precondition.
Question 946
During a design review, the requirement is to create one child module instance for each stable application key. Which option should the engineer select?
- A module with for_each
- A module root directory
- Multiple calls to one module
- A module dependency interface
Explanation
Correct Answer
A:The for_each meta-argument instantiates keyed module instances addressable as module.NAME["key"]; this directly meets the requirement to create one child module instance for each stable application key. By comparison, multiple calls to one module is intended to deploy two independently managed stacks from the same module definition, which is a different task from create one child module instance for each stable application key.
Incorrect Answers
B:All Terraform configuration files in a module directory are combined as one module; filenames do not define separate execution units; this mechanism is useful when the job is to understand which source files Terraform loads as one module, whereas the current scenario requires the engineer to create one child module instance for each stable application key. These operations have different effects in the stated Terraform workflow.
C:Two module blocks that use the same source create separate module instances and separate resource addresses; this mechanism is useful when the job is to deploy two independently managed stacks from the same module definition, whereas the current scenario requires the engineer to create one child module instance for each stable application key. These operations have different effects in the stated Terraform workflow.
D:An output-to-input reference establishes a natural dependency and avoids imposing broad depends_on edges unnecessarily; this mechanism is useful when the job is to connect two modules by declared output and input values, whereas the current scenario requires the engineer to create one child module instance for each stable application key. These operations have different effects in the stated Terraform workflow.
Question 947
The team evaluates “Provider configuration at the root” for a requirement to supply provider configurations from the root module to reusable child modules. Which observed behavior belongs to that mechanism rather than a different Terraform feature?
- An unaliased provider block configures the default instance used by matching resources that do not override provider selection.
- The required_providers entry maps the chosen local name to a specific fully qualified provider source address.
- List both plugins under required_providers and configure each service's provider independently as needed.
- Reusable child modules should primarily declare provider requirements and receive configurations from callers rather than embedding fixed credentials.
- The resource-level provider meta-argument selects a provider instance, not a different backend or Terraform workspace.
Explanation
Correct Answer
D:The named mechanism is used when the objective is to supply provider configurations from the root module to reusable child modules, so it produces the behavior described. In contrast, provider-local name mapping serves a different goal: reuse a provider whose source address differs from its short local identifier, not supply provider configurations from the root module to reusable child modules.
Incorrect Answers
A:The description applies to a default provider configuration when an engineer needs to make resources use a common account without an explicit provider argument; the named provider configuration at the root instead handles the requirement to supply provider configurations from the root module to reusable child modules, so this behavior does not describe Provider configuration at the root in the situation named.
B:The description applies to provider-local name mapping when an engineer needs to reuse a provider whose source address differs from its short local identifier; the named provider configuration at the root instead handles the requirement to supply provider configurations from the root module to reusable child modules, so this behavior does not describe Provider configuration at the root in the situation named.
C:The description applies to separate required provider names when an engineer needs to use two unrelated service APIs in one root configuration; the named provider configuration at the root instead handles the requirement to supply provider configurations from the root module to reusable child modules, so this behavior does not describe Provider configuration at the root in the situation named.
E:The description applies to a resource's provider meta-argument when an engineer needs to route a particular managed object to the named alternate provider configuration; the named provider configuration at the root instead handles the requirement to supply provider configurations from the root module to reusable child modules, so this behavior does not describe Provider configuration at the root in the situation named.
Question 948
During a design review, the requirement is to turn ordinary string content into Base64 text. Which option should the engineer select?
- The contains function
- The lookup function
- The replace function
- The base64encode function
- The dynamic block
Explanation
Correct Answer
D:base64encode applies a reversible encoding and should not be mistaken for encryption of secrets; this directly meets the requirement to turn ordinary string content into Base64 text. By comparison, the contains function is intended to check whether a collection contains a specific element, which is a different task from turn ordinary string content into Base64 text.
Incorrect Answers
A:contains(collection, value) evaluates membership and returns a boolean; this mechanism is useful when the job is to check whether a collection contains a specific element, whereas the current scenario requires the engineer to turn ordinary string content into Base64 text. These operations have different effects in the stated Terraform workflow.
B:lookup(map, key, default) retrieves the selected key's value or the supplied default if the key does not exist; this mechanism is useful when the job is to read a map element and provide a fallback when the key is absent, whereas the current scenario requires the engineer to turn ordinary string content into Base64 text. These operations have different effects in the stated Terraform workflow.
C:replace searches a string for a matching substring or pattern and replaces matches with a new string; this mechanism is useful when the job is to substitute matching substrings within a value, whereas the current scenario requires the engineer to turn ordinary string content into Base64 text. These operations have different effects in the stated Terraform workflow.
E:dynamic constructs blocks required by resource schemas; it does not create standalone Terraform resource declarations; this mechanism is useful when the job is to generate repeated nested blocks from a collection, whereas the current scenario requires the engineer to turn ordinary string content into Base64 text. These operations have different effects in the stated Terraform workflow.
Question 949
An engineer proposes “Using a module registry version” to instantiate a reusable configuration unit under a distinct local name. Which outcome does the proposed technique actually provide?
- The module block's version argument can constrain registry modules and is separate from Terraform CLI and provider version settings.
- The providers map on the module call maps child provider names to selected provider configurations from the root module.
- The module block's source points to child configuration and its other arguments supply input variables and relevant meta-arguments.
- The for_each meta-argument instantiates keyed module instances addressable as module.NAME["key"].
Explanation
Correct Answer
A:Using a module registry version is used when an operator needs to control which published module release a root configuration consumes. Consequently, this choice cannot meet the separate requirement to instantiate a reusable configuration unit under a distinct local name. The intended action would instead require A module call block.
Incorrect Answers
B:This behavior belongs to Module provider mappings, which helps engineers send the correct region-specific provider into a reusable child module rather than satisfying the separate requirement to instantiate a reusable configuration unit under a distinct local name. The attempted technique was Using a module registry version; it would instead be used to control which published module release a root configuration consumes, not to produce the effect associated with Module provider mappings.
C:That outcome belongs to A module call block, the mechanism that can instantiate a reusable configuration unit under a distinct local name. The question concerns the engineer’s actual proposal, Using a module registry version; it is directed at control which published module release a root configuration consumes, not that result.
D:This behavior belongs to A module with for_each, which helps engineers create one child module instance for each stable application key rather than satisfying the separate requirement to instantiate a reusable configuration unit under a distinct local name. The attempted technique was Using a module registry version; it would instead be used to control which published module release a root configuration consumes, not to produce the effect associated with A module with for_each.
Question 950
The team evaluates “A tuple type” for a requirement to require a fixed sequence of potentially different element types. Which observed behavior belongs to that mechanism rather than a different Terraform feature?
- tolist converts compatible values to a list, but a source set's original order is not inherently meaningful.
- A resource's for_each meta-argument accepts maps or sets of strings; map keys appear in resource addresses.
- toset converts a collection into a set; duplicate elements are removed and original positional ordering is not preserved.
- tuple([string, number]) enforces a position-specific sequence with different type constraints.
Explanation
Correct Answer
D:The named mechanism is used when the objective is to require a fixed sequence of potentially different element types, so it produces the behavior described. In contrast, tolist conversion serves a different goal: coerce a suitable collection into a list for ordered operations, not require a fixed sequence of potentially different element types.
Incorrect Answers
A:The description applies to tolist conversion when an engineer needs to coerce a suitable collection into a list for ordered operations; the named a tuple type instead handles the requirement to require a fixed sequence of potentially different element types, so this behavior does not describe A tuple type in the situation named.
B:The description applies to for_each with a map when an engineer needs to create instances using stable logical keys rather than shifting numeric indexes; the named a tuple type instead handles the requirement to require a fixed sequence of potentially different element types, so this behavior does not describe A tuple type in the situation named.
C:The description applies to toset conversion when an engineer needs to deduplicate a collection of string identifiers for keyed iteration; the named a tuple type instead handles the requirement to require a fixed sequence of potentially different element types, so this behavior does not describe A tuple type in the situation named.