Question 330
A configuration walkthrough identifies "terraform state list". Which task is it principally intended to support?
- export state or saved plan information in machine-readable form
- inspect stored attributes for one tracked resource instance
- enumerate Terraform resource addresses currently tracked in a state snapshot
- inspect the latest state or a saved execution plan in readable form
Explanation
Correct Answer
C:The practical result of terraform state list, used to enumerate Terraform resource addresses currently tracked in a state snapshot, is: state list displays managed addresses and can be narrowed with address filters. A qualification for this effect is: It does not enumerate every object in the cloud account.
Incorrect Answers
A:That outcome applies to terraform show -json, intended to export state or saved plan information in machine-readable form, rather than the question's feature terraform state list: show -json emits detailed JSON for supported state and plan representations. Unlike terraform show -json, terraform state list is intended to enumerate Terraform resource addresses currently tracked in a state snapshot, not to export state or saved plan information in machine-readable form.
B:That outcome applies to terraform state show ADDRESS, intended to inspect stored attributes for one tracked resource instance, rather than the question's feature terraform state list: state show presents the state representation of an addressed resource. Unlike terraform state show ADDRESS, terraform state list is intended to enumerate Terraform resource addresses currently tracked in a state snapshot, not to inspect stored attributes for one tracked resource instance.
D:That outcome applies to terraform show, intended to inspect the latest state or a saved execution plan in readable form, rather than the question's feature terraform state list: terraform show can display an existing state snapshot or a named plan file. Unlike terraform show, terraform state list is intended to enumerate Terraform resource addresses currently tracked in a state snapshot, not to inspect the latest state or a saved execution plan in readable form.
Question 331
For a new infrastructure repository, the team wants to restrict an input to an expected Terraform type. Which mechanism most directly meets this particular need?
- Variable default value
- Local value expression
- Variable type constraint
- Required input variable
Explanation
Correct Answer
C:The task is to restrict an input to an expected Terraform type; Variable type constraint directly supports that requirement: A type declaration such as number or object(...) lets Terraform validate and convert compatible inputs. Its relevant boundary is: Type declarations are different from custom semantic validation rules.
Incorrect Answers
A:Variable default value is designed to give a module input a fallback when callers omit it, whereas this task is to restrict an input to an expected Terraform type: A variable default supplies a value without requiring each caller to pass that argument. Against Variable type constraint, its limitation is: Explicit callers can override the default with their own value.
B:Local value expression is designed to name a computed expression used repeatedly inside one module, whereas this task is to restrict an input to an expected Terraform type: locals blocks evaluate named expressions available as local.name within that module. Against Variable type constraint, its limitation is: They are not root-module input variables and cannot be set with -var.
D:Required input variable is designed to prompt for or provide a root-module value when no default exists, whereas this task is to restrict an input to an expected Terraform type: A variable block without a default requires a value supplied through a supported input channel. Against Variable type constraint, its limitation is: Declaring a variable does not itself fetch a remote API value.
Question 332
A team reviews the use of Initialization as safe repeated step in Terraform 1.12. Which purpose matches its actual behavior?
- install externally sourced child modules referenced by the root module
- prepare backend and plugin dependencies before planning
- rerun initialization after adding a provider or changing module sources
- preserve locked provider selections in routine CI initialization
- work on configuration validation while deliberately skipping backend initialization
Explanation
Correct Answer
C:The practical result of Initialization as safe repeated step, used to rerun initialization after adding a provider or changing module sources, is: It is normally safe to run terraform init repeatedly to satisfy updated dependencies. A qualification for this effect is: Reinitialization is not a substitute for planning after configuration changes.
Incorrect Answers
A:That outcome applies to Module download on init, intended to install externally sourced child modules referenced by the root module, rather than the question's feature Initialization as safe repeated step: terraform init resolves module sources and downloads them to the local module cache. Unlike Module download on init, Initialization as safe repeated step is intended to rerun initialization after adding a provider or changing module sources, not to install externally sourced child modules referenced by the root module.
B:That outcome applies to Initialize a new working directory, intended to prepare backend and plugin dependencies before planning, rather than the question's feature Initialization as safe repeated step: terraform init configures backend access and fetches required modules and providers. Unlike Initialize a new working directory, Initialization as safe repeated step is intended to rerun initialization after adding a provider or changing module sources, not to prepare backend and plugin dependencies before planning.
D:That outcome applies to Init provider plugin upgrade control, intended to preserve locked provider selections in routine CI initialization, rather than the question's feature Initialization as safe repeated step: A normal terraform init honors the existing dependency lock selections unless update is requested. Unlike Init provider plugin upgrade control, Initialization as safe repeated step is intended to rerun initialization after adding a provider or changing module sources, not to preserve locked provider selections in routine CI initialization.
E:That outcome applies to Init without backend setup, intended to work on configuration validation while deliberately skipping backend initialization, rather than the question's feature Initialization as safe repeated step: terraform init -backend=false skips the backend initialization step where appropriate. Unlike Init without backend setup, Initialization as safe repeated step is intended to rerun initialization after adding a provider or changing module sources, not to work on configuration validation while deliberately skipping backend initialization.
Question 333
The rollout owner asks whether Provider plugin responsibility is sufficient to translate a Terraform resource operation into remote service API calls. Which limitation specifically concerns that mechanism?
- A provider is not a Terraform module downloaded from a module source.
- An alias must be chosen explicitly if the resource needs a nondefault configuration.
- A generic Terraform language feature cannot invent unsupported provider arguments.
- Terraform itself does not create a cloud instance without an appropriate provider.
Explanation
Correct Answer
D:For Provider plugin responsibility in the task to translate a Terraform resource operation into remote service API calls, the important caution is: Terraform itself does not create a cloud instance without an appropriate provider. The reason this matters is its actual behavior: The provider implements resource types and performs create, read, update, and delete operations when supported.
Incorrect Answers
A:The proposed warning belongs to Plugin dependency installation, which serves the different goal to resolve all referenced provider plugins before planning, rather than to Provider plugin responsibility: An initialized working directory has the plugins required for its configured resources and data sources. The question concerns Provider plugin responsibility acting to translate a Terraform resource operation into remote service API calls, not a limit of Plugin dependency installation.
B:The proposed warning belongs to Provider selection for resource prefix, which serves the different goal to associate a resource with the default provider for its type prefix, rather than to Provider plugin responsibility: Without a provider meta-argument Terraform normally selects the matching local provider configuration. The question concerns Provider plugin responsibility acting to translate a Terraform resource operation into remote service API calls, not a limit of Provider selection for resource prefix.
C:The proposed warning belongs to Provider resource schema, which serves the different goal to define the supported arguments and attributes for one resource type, rather than to Provider plugin responsibility: The provider schema specifies which settings users can configure and which values are computed. The question concerns Provider plugin responsibility acting to translate a Terraform resource operation into remote service API calls, not a limit of Provider resource schema.
Question 334
A configuration walkthrough identifies "Avoid disabling state locks". Which task is it principally intended to support?
- prevent two concurrent runs from writing the same state snapshot
- let a run wait briefly rather than fail immediately when state is busy
- remove a stale lock only after confirming that no valid run owns it
- avoid racing state mutations when several operators run Terraform
- protect shared state rather than using -lock=false as a routine workaround
Explanation
Correct Answer
E:The practical result of Avoid disabling state locks, used to protect shared state rather than using -lock=false as a routine workaround, is: Using a lock-capable backend with normal locking reduces state races. A qualification for this effect is: -lock=false makes concurrent writers potentially unsafe.
Incorrect Answers
A:That outcome applies to Terraform state locking, intended to prevent two concurrent runs from writing the same state snapshot, rather than the question's feature Avoid disabling state locks: A backend with locking support serializes operations that could corrupt shared state. Unlike Terraform state locking, Avoid disabling state locks is intended to protect shared state rather than using -lock=false as a routine workaround, not to prevent two concurrent runs from writing the same state snapshot.
B:That outcome applies to terraform -lock-timeout behavior, intended to let a run wait briefly rather than fail immediately when state is busy, rather than the question's feature Avoid disabling state locks: The lock-timeout flag controls how long supported operations retry obtaining a lock. Unlike terraform -lock-timeout behavior, Avoid disabling state locks is intended to protect shared state rather than using -lock=false as a routine workaround, not to let a run wait briefly rather than fail immediately when state is busy.
C:That outcome applies to terraform force-unlock, intended to remove a stale lock only after confirming that no valid run owns it, rather than the question's feature Avoid disabling state locks: force-unlock accepts a lock ID and bypasses normal waiting for an abandoned lock. Unlike terraform force-unlock, Avoid disabling state locks is intended to protect shared state rather than using -lock=false as a routine workaround, not to remove a stale lock only after confirming that no valid run owns it.
D:That outcome applies to Lock acquisition before writes, intended to avoid racing state mutations when several operators run Terraform, rather than the question's feature Avoid disabling state locks: Terraform tries to obtain a state lock when the chosen backend supports it. Unlike Lock acquisition before writes, Avoid disabling state locks is intended to protect shared state rather than using -lock=false as a routine workaround, not to avoid racing state mutations when several operators run Terraform.
Question 335
During an implementation review, a Terraform team encounters "Provider configuration scope". Which purpose is associated with that mechanism?
- keep provider instances configured in the root and pass them to child modules
- pass a caller-defined value into a reusable child module
- expose specific child values to its parent with an output block
- distinguish CLI-supplied root inputs from child inputs
- compute module-specific intermediate values without exporting them
Explanation
Correct Answer
A:The practical result of Provider configuration scope, used to keep provider instances configured in the root and pass them to child modules, is: A root module can explicitly map provider configurations into child module calls. A qualification for this effect is: An aliased provider is not automatically inherited as a child alias.
Incorrect Answers
B:That outcome applies to Child module input variable, intended to pass a caller-defined value into a reusable child module, rather than the question's feature Provider configuration scope: The child declares a variable and the parent's module block assigns a value to that argument. Unlike Child module input variable, Provider configuration scope is intended to keep provider instances configured in the root and pass them to child modules, not to pass a caller-defined value into a reusable child module.
C:That outcome applies to Child module output scope, intended to expose specific child values to its parent with an output block, rather than the question's feature Provider configuration scope: The parent can use module.child.output_name only when the child explicitly declares that output. Unlike Child module output scope, Provider configuration scope is intended to keep provider instances configured in the root and pass them to child modules, not to expose specific child values to its parent with an output block.
D:That outcome applies to Root variable namespace, intended to distinguish CLI-supplied root inputs from child inputs, rather than the question's feature Provider configuration scope: CLI -var arguments set variables declared in the root module; child values pass through module call arguments. Unlike Root variable namespace, Provider configuration scope is intended to keep provider instances configured in the root and pass them to child modules, not to distinguish CLI-supplied root inputs from child inputs.
E:That outcome applies to Module local values, intended to compute module-specific intermediate values without exporting them, rather than the question's feature Provider configuration scope: Local values belong to the defining module and are referenced through local.name in that scope. Unlike Module local values, Provider configuration scope is intended to keep provider instances configured in the root and pass them to child modules, not to compute module-specific intermediate values without exporting them.
Question 336
A Terraform runbook describes the mechanism "HCP Terraform drift detection". Which responsibility should a reviewer associate with it?
- share approved reusable modules within an organization
- avoid long-lived static cloud credentials in workspace variables
- monitor for resources that have diverged from workspace configuration
- share reusable variables across selected workspaces
- retain run and change history for collaboration and review
Explanation
Correct Answer
C:The practical result of HCP Terraform drift detection, used to monitor for resources that have diverged from workspace configuration, is: Health assessments can identify drift between tracked resources and desired configuration. A qualification for this effect is: HCP Terraform health assessments require Standard or Premium edition and an eligible workspace; detection itself does not automatically correct drift.
Incorrect Answers
A:That outcome applies to HCP Terraform private module registry, intended to share approved reusable modules within an organization, rather than the question's feature HCP Terraform drift detection: A private registry distributes versioned modules to organization workspaces and teams. Unlike HCP Terraform private module registry, HCP Terraform drift detection is intended to monitor for resources that have diverged from workspace configuration, not to share approved reusable modules within an organization.
B:That outcome applies to HCP Terraform dynamic provider credentials, intended to avoid long-lived static cloud credentials in workspace variables, rather than the question's feature HCP Terraform drift detection: Supported dynamic credentials issue time-limited tokens to runs based on trust configuration. Unlike HCP Terraform dynamic provider credentials, HCP Terraform drift detection is intended to monitor for resources that have diverged from workspace configuration, not to avoid long-lived static cloud credentials in workspace variables.
D:That outcome applies to HCP Terraform variable sets, intended to share reusable variables across selected workspaces, rather than the question's feature HCP Terraform drift detection: Variable sets can provide common Terraform or environment variables to applicable workspaces. Unlike HCP Terraform variable sets, HCP Terraform drift detection is intended to monitor for resources that have diverged from workspace configuration, not to share reusable variables across selected workspaces.
E:That outcome applies to HCP Terraform auditability, intended to retain run and change history for collaboration and review, rather than the question's feature HCP Terraform drift detection: Workspace run histories help teams trace proposed and executed infrastructure operations. Unlike HCP Terraform auditability, HCP Terraform drift detection is intended to monitor for resources that have diverged from workspace configuration, not to retain run and change history for collaboration and review.
Question 337
An operator chooses the mechanism "Variable type constraint" for a Terraform project. Which outcome should this choice support?
- name a computed expression used repeatedly inside one module
- restrict an input to an expected Terraform type
- prompt for or provide a root-module value when no default exists
- give a module input a fallback when callers omit it
Explanation
Correct Answer
B:The practical result of Variable type constraint, used to restrict an input to an expected Terraform type, is: A type declaration such as number or object(...) lets Terraform validate and convert compatible inputs. A qualification for this effect is: Type declarations are different from custom semantic validation rules.
Incorrect Answers
A:That outcome applies to Local value expression, intended to name a computed expression used repeatedly inside one module, rather than the question's feature Variable type constraint: locals blocks evaluate named expressions available as local.name within that module. Unlike Local value expression, Variable type constraint is intended to restrict an input to an expected Terraform type, not to name a computed expression used repeatedly inside one module.
C:That outcome applies to Required input variable, intended to prompt for or provide a root-module value when no default exists, rather than the question's feature Variable type constraint: A variable block without a default requires a value supplied through a supported input channel. Unlike Required input variable, Variable type constraint is intended to restrict an input to an expected Terraform type, not to prompt for or provide a root-module value when no default exists.
D:That outcome applies to Variable default value, intended to give a module input a fallback when callers omit it, rather than the question's feature Variable type constraint: A variable default supplies a value without requiring each caller to pass that argument. Unlike Variable default value, Variable type constraint is intended to restrict an input to an expected Terraform type, not to give a module input a fallback when callers omit it.
Question 338
Before adopting Version-controlled configuration history to trace why infrastructure definitions changed, which statement sets an accurate boundary?
- Differences in inputs and provider versions can still alter actual results.
- Source approval does not replace inspecting the execution plan.
- Automation must still control credentials and state concurrency.
- A Git diff tracks source files rather than proving the exact live infrastructure state.
Explanation
Correct Answer
D:For Version-controlled configuration history in the task to trace why infrastructure definitions changed, the important caution is: A Git diff tracks source files rather than proving the exact live infrastructure state. The reason this matters is its actual behavior: Git commits and pull requests make configuration edits auditable before the next Terraform run.
Incorrect Answers
A:The proposed warning belongs to Repeatable environment provisioning, which serves the different goal to recreate equivalent infrastructure patterns from one codebase, rather than to Version-controlled configuration history: Parameterizing reusable Terraform modules can provision consistent environment patterns repeatedly. The question concerns Version-controlled configuration history acting to trace why infrastructure definitions changed, not a limit of Repeatable environment provisioning.
B:The proposed warning belongs to Peer review for infrastructure, which serves the different goal to require approval before risky infrastructure changes, rather than to Version-controlled configuration history: Text configuration can be reviewed through a normal code review before an approved apply. The question concerns Version-controlled configuration history acting to trace why infrastructure definitions changed, not a limit of Peer review for infrastructure.
C:The proposed warning belongs to Automated provisioning pipeline, which serves the different goal to replace repetitive click-by-click resource deployment with a pipeline, rather than to Version-controlled configuration history: A CI pipeline can run validation and planning before an authorized apply, reducing procedural inconsistency. The question concerns Version-controlled configuration history acting to trace why infrastructure definitions changed, not a limit of Automated provisioning pipeline.
Question 339
Before adopting terraform state list to enumerate Terraform resource addresses currently tracked in a state snapshot, which statement sets an accurate boundary?
- It does not enumerate every object in the cloud account.
- Sensitive values can appear in cleartext and output needs access controls.
- It does not perform an infrastructure change or show another resource automatically.
- It is not the same as running a fresh plan against current infrastructure.
- Editing and pushing the JSON should not be treated as a routine management workflow.
Explanation
Correct Answer
A:For terraform state list in the task to enumerate Terraform resource addresses currently tracked in a state snapshot, the important caution is: It does not enumerate every object in the cloud account. The reason this matters is its actual behavior: state list displays managed addresses and can be narrowed with address filters.
Incorrect Answers
B:The proposed warning belongs to terraform show -json, which serves the different goal to export state or saved plan information in machine-readable form, rather than to terraform state list: show -json emits detailed JSON for supported state and plan representations. The question concerns terraform state list acting to enumerate Terraform resource addresses currently tracked in a state snapshot, not a limit of terraform show -json.
C:The proposed warning belongs to terraform state show ADDRESS, which serves the different goal to inspect stored attributes for one tracked resource instance, rather than to terraform state list: state show presents the state representation of an addressed resource. The question concerns terraform state list acting to enumerate Terraform resource addresses currently tracked in a state snapshot, not a limit of terraform state show ADDRESS.
D:The proposed warning belongs to terraform show, which serves the different goal to inspect the latest state or a saved execution plan in readable form, rather than to terraform state list: terraform show can display an existing state snapshot or a named plan file. The question concerns terraform state list acting to enumerate Terraform resource addresses currently tracked in a state snapshot, not a limit of terraform show.
E:The proposed warning belongs to terraform state pull, which serves the different goal to retrieve the current backend state snapshot as serialized JSON, rather than to terraform state list: state pull reads state from the configured backend for inspection or backup handling. The question concerns terraform state list acting to enumerate Terraform resource addresses currently tracked in a state snapshot, not a limit of terraform state pull.
Question 340
A change proposal relies on Initialization as safe repeated step for the task to rerun initialization after adding a provider or changing module sources. Which limitation specifically applies to it?
- Reinitialization is not a substitute for planning after configuration changes.
- A changed constraint can require an explicit upgrade or other resolution.
- Commands needing live state might not work without a configured backend.
- Downloading a module does not create its infrastructure.
Explanation
Correct Answer
A:For Initialization as safe repeated step in the task to rerun initialization after adding a provider or changing module sources, the important caution is: Reinitialization is not a substitute for planning after configuration changes. The reason this matters is its actual behavior: It is normally safe to run terraform init repeatedly to satisfy updated dependencies.
Incorrect Answers
B:The proposed warning belongs to Init provider plugin upgrade control, which serves the different goal to preserve locked provider selections in routine CI initialization, rather than to Initialization as safe repeated step: A normal terraform init honors the existing dependency lock selections unless update is requested. The question concerns Initialization as safe repeated step acting to rerun initialization after adding a provider or changing module sources, not a limit of Init provider plugin upgrade control.
C:The proposed warning belongs to Init without backend setup, which serves the different goal to work on configuration validation while deliberately skipping backend initialization, rather than to Initialization as safe repeated step: terraform init -backend=false skips the backend initialization step where appropriate. The question concerns Initialization as safe repeated step acting to rerun initialization after adding a provider or changing module sources, not a limit of Init without backend setup.
D:The proposed warning belongs to Module download on init, which serves the different goal to install externally sourced child modules referenced by the root module, rather than to Initialization as safe repeated step: terraform init resolves module sources and downloads them to the local module cache. The question concerns Initialization as safe repeated step acting to rerun initialization after adding a provider or changing module sources, not a limit of Module download on init.