Question 290
A Terraform rollout has two separate requirements: first, remove a stale lock only after confirming that no valid run owns it; second, protect shared state rather than using -lock=false as a routine workaround. Which assignment of mechanisms correctly handles both responsibilities?
- First use terraform force-unlock; then use Lock identifier verification.
- First use terraform force-unlock; then use Avoid disabling state locks.
- First use Lock identifier verification; then use Remote backend locking capabilities.
- First use Avoid disabling state locks; then use terraform force-unlock.
- First use Remote backend locking capabilities; then use Avoid disabling state locks.
Explanation
Correct Answer
B:The first requirement, to remove a stale lock only after confirming that no valid run owns it, is handled by terraform force-unlock: force-unlock accepts a lock ID and bypasses normal waiting for an abandoned lock. The second requirement, to protect shared state rather than using -lock=false as a routine workaround, is handled by Avoid disabling state locks: Using a lock-capable backend with normal locking reduces state races. Each of these mechanisms has a distinct responsibility.
Incorrect Answers
A:For the requested tasks to remove a stale lock only after confirming that no valid run owns it and protect shared state rather than using -lock=false as a routine workaround, the first candidate terraform force-unlock addresses remove a stale lock only after confirming that no valid run owns it; the second candidate Lock identifier verification addresses identify the precise stale lock before taking exceptional recovery action. This mapping fails because the second mechanism primarily supports the task to identify the precise stale lock before taking exceptional recovery action; the actual requirements are remove a stale lock only after confirming that no valid run owns it first and protect shared state rather than using -lock=false as a routine workaround second.
C:For the requested tasks to remove a stale lock only after confirming that no valid run owns it and protect shared state rather than using -lock=false as a routine workaround, the first candidate Lock identifier verification addresses identify the precise stale lock before taking exceptional recovery action; the second candidate Remote backend locking capabilities addresses select shared state storage with appropriate concurrency semantics. This mapping fails because the first mechanism primarily supports the task to identify the precise stale lock before taking exceptional recovery action and the second mechanism primarily supports the task to select shared state storage with appropriate concurrency semantics; the actual requirements are remove a stale lock only after confirming that no valid run owns it first and protect shared state rather than using -lock=false as a routine workaround second.
D:For the requested tasks to remove a stale lock only after confirming that no valid run owns it and protect shared state rather than using -lock=false as a routine workaround, the first candidate Avoid disabling state locks addresses protect shared state rather than using -lock=false as a routine workaround; the second candidate terraform force-unlock addresses remove a stale lock only after confirming that no valid run owns it. This mapping fails because the first mechanism primarily supports the task to protect shared state rather than using -lock=false as a routine workaround and the second mechanism primarily supports the task to remove a stale lock only after confirming that no valid run owns it; the actual requirements are remove a stale lock only after confirming that no valid run owns it first and protect shared state rather than using -lock=false as a routine workaround second.
E:For the requested tasks to remove a stale lock only after confirming that no valid run owns it and protect shared state rather than using -lock=false as a routine workaround, the first candidate Remote backend locking capabilities addresses select shared state storage with appropriate concurrency semantics; the second candidate Avoid disabling state locks addresses protect shared state rather than using -lock=false as a routine workaround. This mapping fails because the first mechanism primarily supports the task to select shared state storage with appropriate concurrency semantics; the actual requirements are remove a stale lock only after confirming that no valid run owns it first and protect shared state rather than using -lock=false as a routine workaround second.
Question 291
A Terraform rollout has two separate requirements: first, distinguish CLI-supplied root inputs from child inputs; second, keep provider instances configured in the root and pass them to child modules. Which assignment of mechanisms correctly handles both responsibilities?
- First use Root variable namespace; then use Provider configuration scope.
- First use Module outputs with repeated instances; then use Provider configuration scope.
- First use Root variable namespace; then use Module input defaults.
- First use Provider configuration scope; then use Root variable namespace.
- First use Module input defaults; then use Module outputs with repeated instances.
Explanation
Correct Answer
A:The first requirement, to distinguish CLI-supplied root inputs from child inputs, is handled by Root variable namespace: CLI -var arguments set variables declared in the root module; child values pass through module call arguments. The second requirement, to keep provider instances configured in the root and pass them to child modules, is handled by Provider configuration scope: A root module can explicitly map provider configurations into child module calls. Each of these mechanisms has a distinct responsibility.
Incorrect Answers
B:For the requested tasks to distinguish CLI-supplied root inputs from child inputs and keep provider instances configured in the root and pass them to child modules, the first candidate Module outputs with repeated instances addresses read values from every instance created by a counted or keyed module call; the second candidate Provider configuration scope addresses keep provider instances configured in the root and pass them to child modules. This mapping fails because the first mechanism primarily supports the task to read values from every instance created by a counted or keyed module call; the actual requirements are distinguish CLI-supplied root inputs from child inputs first and keep provider instances configured in the root and pass them to child modules second.
C:For the requested tasks to distinguish CLI-supplied root inputs from child inputs and keep provider instances configured in the root and pass them to child modules, the first candidate Root variable namespace addresses distinguish CLI-supplied root inputs from child inputs; the second candidate Module input defaults addresses make some child module arguments optional for callers. This mapping fails because the second mechanism primarily supports the task to make some child module arguments optional for callers; the actual requirements are distinguish CLI-supplied root inputs from child inputs first and keep provider instances configured in the root and pass them to child modules second.
D:For the requested tasks to distinguish CLI-supplied root inputs from child inputs and keep provider instances configured in the root and pass them to child modules, the first candidate Provider configuration scope addresses keep provider instances configured in the root and pass them to child modules; the second candidate Root variable namespace addresses distinguish CLI-supplied root inputs from child inputs. This mapping fails because the first mechanism primarily supports the task to keep provider instances configured in the root and pass them to child modules and the second mechanism primarily supports the task to distinguish CLI-supplied root inputs from child inputs; the actual requirements are distinguish CLI-supplied root inputs from child inputs first and keep provider instances configured in the root and pass them to child modules second.
E:For the requested tasks to distinguish CLI-supplied root inputs from child inputs and keep provider instances configured in the root and pass them to child modules, the first candidate Module input defaults addresses make some child module arguments optional for callers; the second candidate Module outputs with repeated instances addresses read values from every instance created by a counted or keyed module call. This mapping fails because the first mechanism primarily supports the task to make some child module arguments optional for callers and the second mechanism primarily supports the task to read values from every instance created by a counted or keyed module call; the actual requirements are distinguish CLI-supplied root inputs from child inputs first and keep provider instances configured in the root and pass them to child modules second.
Question 292
A Terraform rollout has two separate requirements: first, grant workspace access based on collaboration responsibilities; second, monitor for resources that have diverged from workspace configuration. Which assignment of mechanisms correctly handles both responsibilities?
- First use HCP Terraform teams and permissions; then use HCP Terraform drift detection.
- First use HCP Terraform drift detection; then use HCP Terraform teams and permissions.
- First use HCP Terraform teams and permissions; then use HCP Terraform dynamic provider credentials.
- First use HCP Terraform dynamic provider credentials; then use HCP Terraform auditability.
- First use HCP Terraform auditability; then use HCP Terraform drift detection.
Explanation
Correct Answer
A:The first requirement, to grant workspace access based on collaboration responsibilities, is handled by HCP Terraform teams and permissions: Teams can be assigned appropriate workspace permissions for viewing, planning, and applying. The second requirement, to monitor for resources that have diverged from workspace configuration, is handled by HCP Terraform drift detection: Health assessments can identify drift between tracked resources and desired configuration. Each of these mechanisms has a distinct responsibility.
Incorrect Answers
B:For the requested tasks to grant workspace access based on collaboration responsibilities and monitor for resources that have diverged from workspace configuration, the first candidate HCP Terraform drift detection addresses monitor for resources that have diverged from workspace configuration; the second candidate HCP Terraform teams and permissions addresses grant workspace access based on collaboration responsibilities. This mapping fails because the first mechanism primarily supports the task to monitor for resources that have diverged from workspace configuration and the second mechanism primarily supports the task to grant workspace access based on collaboration responsibilities; the actual requirements are grant workspace access based on collaboration responsibilities first and monitor for resources that have diverged from workspace configuration second.
C:For the requested tasks to grant workspace access based on collaboration responsibilities and monitor for resources that have diverged from workspace configuration, the first candidate HCP Terraform teams and permissions addresses grant workspace access based on collaboration responsibilities; the second candidate HCP Terraform dynamic provider credentials addresses avoid long-lived static cloud credentials in workspace variables. This mapping fails because the second mechanism primarily supports the task to avoid long-lived static cloud credentials in workspace variables; the actual requirements are grant workspace access based on collaboration responsibilities first and monitor for resources that have diverged from workspace configuration second.
D:For the requested tasks to grant workspace access based on collaboration responsibilities and monitor for resources that have diverged from workspace configuration, the first candidate HCP Terraform dynamic provider credentials addresses avoid long-lived static cloud credentials in workspace variables; the second candidate HCP Terraform auditability addresses retain run and change history for collaboration and review. This mapping fails because the first mechanism primarily supports the task to avoid long-lived static cloud credentials in workspace variables and the second mechanism primarily supports the task to retain run and change history for collaboration and review; the actual requirements are grant workspace access based on collaboration responsibilities first and monitor for resources that have diverged from workspace configuration second.
E:For the requested tasks to grant workspace access based on collaboration responsibilities and monitor for resources that have diverged from workspace configuration, the first candidate HCP Terraform auditability addresses retain run and change history for collaboration and review; the second candidate HCP Terraform drift detection addresses monitor for resources that have diverged from workspace configuration. This mapping fails because the first mechanism primarily supports the task to retain run and change history for collaboration and review; the actual requirements are grant workspace access based on collaboration responsibilities first and monitor for resources that have diverged from workspace configuration second.
Question 293
During an implementation review, a Terraform team encounters "Reference-based evaluation order". Which purpose is associated with that mechanism?
- select the exact indexed instance from count-created resources
- avoid assuming files or block order determines operations
- pass the generated ID of one resource into a dependent resource
- ensure a dependent resource waits for a referenced upstream attribute
Explanation
Correct Answer
B:The practical result of Reference-based evaluation order, used to avoid assuming files or block order determines operations, is: Terraform's graph follows expression dependencies, not the physical line order of configuration blocks. A qualification for this effect is: References can still form invalid cycles if dependencies point back to each other.
Incorrect Answers
A:That outcome applies to Resource address for count instance, intended to select the exact indexed instance from count-created resources, rather than the question's feature Reference-based evaluation order: Count-created instances use numeric indices in expressions and state addresses, such as example[1]. Unlike Resource address for count instance, Reference-based evaluation order is intended to avoid assuming files or block order determines operations, not to select the exact indexed instance from count-created resources.
C:That outcome applies to Direct attribute reference, intended to pass the generated ID of one resource into a dependent resource, rather than the question's feature Reference-based evaluation order: An expression such as aws_vpc.main.id links a consuming argument to an upstream resource attribute. Unlike Direct attribute reference, Reference-based evaluation order is intended to avoid assuming files or block order determines operations, not to pass the generated ID of one resource into a dependent resource.
D:That outcome applies to Implicit resource dependency, intended to ensure a dependent resource waits for a referenced upstream attribute, rather than the question's feature Reference-based evaluation order: Terraform infers dependencies when expressions reference other resources. Unlike Implicit resource dependency, Reference-based evaluation order is intended to avoid assuming files or block order determines operations, not to ensure a dependent resource waits for a referenced upstream attribute.
Question 294
The team is documenting risks of Infrastructure provider API while planning to translate declarative resources into operations on a platform. Which caveat specifically applies to that mechanism?
- Terraform Core does not hard-code each cloud service API.
- Reviewing a plan is different from committing its effects to the remote system.
- The configuration still needs a tool and credentials to change actual systems.
- An external drift or changed input can still cause a nonempty plan.
Explanation
Correct Answer
A:For Infrastructure provider API in the task to translate declarative resources into operations on a platform, the important caution is: Terraform Core does not hard-code each cloud service API. The reason this matters is its actual behavior: Provider plugins supply resource implementations and call remote APIs when Terraform reconciles infrastructure.
Incorrect Answers
B:The proposed warning belongs to Infrastructure execution plan, which serves the different goal to preview the proposed actions before changing real resources, rather than to Infrastructure provider API: A Terraform plan calculates proposed actions from configuration, state, providers, and current observations. The question concerns Infrastructure provider API acting to translate declarative resources into operations on a platform, not a limit of Infrastructure execution plan.
C:The listed caution belongs specifically to Infrastructure as code definition, used to represent desired infrastructure in reviewable configuration files: Infrastructure as code describes infrastructure through machine-readable files instead of relying only on manual console operations; the feature under review is instead Infrastructure provider API, so this answer attaches another feature's qualification to the wrong mechanism.
D:The proposed warning belongs to Idempotent reconciliation, which serves the different goal to repeat an apply without recreating already matching resources, rather than to Infrastructure provider API: Terraform compares desired configuration with prior state and refreshed remote information and normally plans no change when they agree. The question concerns Infrastructure provider API acting to translate declarative resources into operations on a platform, not a limit of Idempotent reconciliation.
Question 295
The team is documenting risks of Import validation follow-up while planning to run a plan after importing an object to check unexpected updates. Which caveat specifically applies to that mechanism?
- Generated HCL requires review and may include attributes needing cleanup.
- The import command alone does not generate a complete root configuration.
- Import success alone does not prove the next apply is a no-op.
- A post-import plan must still be checked for configuration differences.
Explanation
Correct Answer
C:For Import validation follow-up in the task to run a plan after importing an object to check unexpected updates, the important caution is: Import success alone does not prove the next apply is a no-op. The reason this matters is its actual behavior: A post-import plan reveals whether declared settings match the newly adopted remote object.
Incorrect Answers
A:The proposed warning belongs to Generate import configuration where supported, which serves the different goal to use import planning support to help write resource HCL for an existing object, rather than to Import validation follow-up: Terraform supports generating configuration with appropriate import workflows for certain imported resources. The question concerns Import validation follow-up acting to run a plan after importing an object to check unexpected updates, not a limit of Generate import configuration where supported.
B:The listed caution belongs specifically to terraform import CLI, used to bring a pre-existing remote object under a resource address in Terraform state: terraform import ADDRESS ID binds the specified remote object to a declared resource instance; the feature under review is instead Import validation follow-up, so this answer attaches another feature's qualification to the wrong mechanism.
D:The proposed warning belongs to Import without recreation, which serves the different goal to adopt an existing object rather than creating a new duplicate, rather than to Import validation follow-up: Import connects an existing provider object to the Terraform state mapping. The question concerns Import validation follow-up acting to run a plan after importing an object to check unexpected updates, not a limit of Import without recreation.
Question 296
A platform engineering group needs to install externally sourced child modules referenced by the root module. Which mechanism most directly meets this particular need?
- Backend migration during init
- Initialize a new working directory
- Module download on init
- Initialization as safe repeated step
Explanation
Correct Answer
C:The task is to install externally sourced child modules referenced by the root module; Module download on init directly supports that requirement: terraform init resolves module sources and downloads them to the local module cache. Its relevant boundary is: Downloading a module does not create its infrastructure.
Incorrect Answers
A:Backend migration during init is designed to move existing state to a newly selected backend when changing its storage, whereas this task is to install externally sourced child modules referenced by the root module: terraform init -migrate-state offers state migration when a backend configuration changes. Against Module download on init, its limitation is: Operators should safeguard and verify state before a migration.
B:Initialize a new working directory is designed to prepare backend and plugin dependencies before planning, whereas this task is to install externally sourced child modules referenced by the root module: terraform init configures backend access and fetches required modules and providers. Against Module download on init, its limitation is: Initialization is not the command for creating managed resources.
D:Initialization as safe repeated step addresses the different requirement to rerun initialization after adding a provider or changing module sources: It is normally safe to run terraform init repeatedly to satisfy updated dependencies; this does not by itself satisfy the requested task to install externally sourced child modules referenced by the root module. For the stated need, Module download on init is the more direct mechanism.
Question 297
During a Terraform 1.12 implementation, the immediate requirement is to let a run wait briefly rather than fail immediately when state is busy. Which mechanism most directly meets this particular need?
- Remote backend locking capabilities
- Avoid disabling state locks
- Lock identifier verification
- terraform -lock-timeout behavior
Explanation
Correct Answer
D:The task is to let a run wait briefly rather than fail immediately when state is busy; terraform -lock-timeout behavior directly supports that requirement: The lock-timeout flag controls how long supported operations retry obtaining a lock. Its relevant boundary is: It does not itself activate locking on a backend that lacks that feature.
Incorrect Answers
A:Remote backend locking capabilities is designed to select shared state storage with appropriate concurrency semantics, whereas this task is to let a run wait briefly rather than fail immediately when state is busy: Supported remote backends can coordinate locking around updates to common state. Against terraform -lock-timeout behavior, its limitation is: Remote storage and locking are related but distinct capabilities.
B:Avoid disabling state locks is designed to protect shared state rather than using -lock=false as a routine workaround, whereas this task is to let a run wait briefly rather than fail immediately when state is busy: Using a lock-capable backend with normal locking reduces state races. Against terraform -lock-timeout behavior, its limitation is: -lock=false makes concurrent writers potentially unsafe.
C:Lock identifier verification is designed to identify the precise stale lock before taking exceptional recovery action, whereas this task is to let a run wait briefly rather than fail immediately when state is busy: A lock ID should be matched to the blocked state operation before unlocking. Against terraform -lock-timeout behavior, its limitation is: Guessing an ID or acting during an active deployment can corrupt coordination.
Question 298
The team is documenting risks of Reference-based evaluation order while planning to avoid assuming files or block order determines operations. Which caveat specifically applies to that mechanism?
- Using a plain string ID loses that implicit graph dependency.
- An explicit depends_on is unnecessary for relationships already expressed through references.
- The index is not a stable semantic key if list ordering changes.
- References can still form invalid cycles if dependencies point back to each other.
Explanation
Correct Answer
D:For Reference-based evaluation order in the task to avoid assuming files or block order determines operations, the important caution is: References can still form invalid cycles if dependencies point back to each other. The reason this matters is its actual behavior: Terraform's graph follows expression dependencies, not the physical line order of configuration blocks.
Incorrect Answers
A:The proposed warning belongs to Direct attribute reference, which serves the different goal to pass the generated ID of one resource into a dependent resource, rather than to Reference-based evaluation order: An expression such as aws_vpc.main.id links a consuming argument to an upstream resource attribute. The question concerns Reference-based evaluation order acting to avoid assuming files or block order determines operations, not a limit of Direct attribute reference.
B:The proposed warning belongs to Implicit resource dependency, which serves the different goal to ensure a dependent resource waits for a referenced upstream attribute, rather than to Reference-based evaluation order: Terraform infers dependencies when expressions reference other resources. The question concerns Reference-based evaluation order acting to avoid assuming files or block order determines operations, not a limit of Implicit resource dependency.
C:The proposed warning belongs to Resource address for count instance, which serves the different goal to select the exact indexed instance from count-created resources, rather than to Reference-based evaluation order: Count-created instances use numeric indices in expressions and state addresses, such as example[1]. The question concerns Reference-based evaluation order acting to avoid assuming files or block order determines operations, not a limit of Resource address for count instance.
Question 299
In a reusable deployment, the primary objective is to compute module-specific intermediate values without exporting them. Which mechanism most directly meets this particular need?
- Module local values
- Provider configuration scope
- Module input defaults
- Module outputs with repeated instances
Explanation
Correct Answer
A:The task is to compute module-specific intermediate values without exporting them; Module local values directly supports that requirement: Local values belong to the defining module and are referenced through local.name in that scope. Its relevant boundary is: They are not automatically exposed through a module output reference.
Incorrect Answers
B:Provider configuration scope is designed to keep provider instances configured in the root and pass them to child modules, whereas this task is to compute module-specific intermediate values without exporting them: A root module can explicitly map provider configurations into child module calls. Against Module local values, its limitation is: An aliased provider is not automatically inherited as a child alias.
C:Module input defaults is designed to make some child module arguments optional for callers, whereas this task is to compute module-specific intermediate values without exporting them: A child variable with a default can be omitted by the caller, allowing the child to use its fallback. Against Module local values, its limitation is: A default does not override an explicitly passed module argument.
D:Module outputs with repeated instances is designed to read values from every instance created by a counted or keyed module call, whereas this task is to compute module-specific intermediate values without exporting them: Counted module outputs use numeric indices; for_each module outputs use instance keys. Against Module local values, its limitation is: A repeated module call is not the same value shape as a single module output object.
Question 300
A reviewer is asked to choose a mechanism to share reusable variables across selected workspaces. Which mechanism most directly meets this particular need?
- HCP Terraform private module registry
- HCP Terraform teams and permissions
- HCP Terraform variable sets
- HCP Terraform policy sets
Explanation
Correct Answer
C:The task is to share reusable variables across selected workspaces; HCP Terraform variable sets directly supports that requirement: Variable sets can provide common Terraform or environment variables to applicable workspaces. Its relevant boundary is: Per-workspace values and precedence must be reviewed when there are overlaps.
Incorrect Answers
A:HCP Terraform private module registry is designed to share approved reusable modules within an organization, whereas this task is to share reusable variables across selected workspaces: A private registry distributes versioned modules to organization workspaces and teams. Against HCP Terraform variable sets, its limitation is: Publishing a module is different from executing a workspace run.
B:HCP Terraform teams and permissions is designed to grant workspace access based on collaboration responsibilities, whereas this task is to share reusable variables across selected workspaces: Teams can be assigned appropriate workspace permissions for viewing, planning, and applying. Against HCP Terraform variable sets, its limitation is: Team permission management requires a supported paid HCP Terraform edition; these roles do not replace cloud-provider permissions.
D:HCP Terraform policy sets is designed to enforce organizational rules during infrastructure runs, whereas this task is to share reusable variables across selected workspaces: HCP Terraform can evaluate governance policies such as Sentinel or OPA as part of run controls. Against HCP Terraform variable sets, its limitation is: Policies assess plans or configuration; they are not Terraform resource providers.