Question 500
A team compares Terraform mechanisms for the goal to respond after changing the source address of a required provider. Which stated consequence belongs specifically to “Provider source change reinitialization”?
- The get=false switch skips child module installation, which is generally safe only if module dependencies are already present.
- A modified provider requirement can trigger a need to rerun init to resolve the newly declared plugin dependency.
- This option provides backend configuration values separately from static code, although locally cached backend settings may still contain secrets.
- Terraform records provider version and checksum selections in its dependency lock file, which teams normally commit to source control.
Explanation
Correct Answer
B:The named mechanism is used when the objective is to respond after changing the source address of a required provider, so it produces the behavior described. In contrast, terraform init -get=false serves a different goal: avoid downloading child modules during a narrowly scoped initialization, not respond after changing the source address of a required provider.
Incorrect Answers
A:The description applies to terraform init -get=false when an engineer needs to avoid downloading child modules during a narrowly scoped initialization; the named provider source change reinitialization instead handles the requirement to respond after changing the source address of a required provider, so this behavior does not describe Provider source change reinitialization in the situation named.
C:The description applies to terraform init -backend-config when an engineer needs to inject partial backend settings at initialization time; the named provider source change reinitialization instead handles the requirement to respond after changing the source address of a required provider, so this behavior does not describe Provider source change reinitialization in the situation named.
D: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 provider source change reinitialization instead handles the requirement to respond after changing the source address of a required provider, so this behavior does not describe Provider source change reinitialization in the situation named.
Question 501
During a design review, the requirement is to compute and reuse a derived expression without asking callers to supply it. Which option should the engineer select?
- A sensitive output
- A locals block
- A terraform.tfvars file
- The -var-file option
Explanation
Correct Answer
B:Local values are internal named expressions accessed using local.NAME; they are not module input parameters; this directly meets the requirement to compute and reuse a derived expression without asking callers to supply it. By comparison, a sensitive output is intended to hide a secret-like output from Terraform's usual human-readable display, which is a different task from compute and reuse a derived expression without asking callers to supply it.
Incorrect Answers
A:Marking an output sensitive redacts ordinary CLI presentation, but does not by itself prevent storage in state; this mechanism is useful when the job is to hide a secret-like output from Terraform's usual human-readable display, whereas the current scenario requires the engineer to compute and reuse a derived expression without asking callers to supply it. These operations have different effects in the stated Terraform workflow.
C:Terraform automatically discovers terraform.tfvars and terraform.tfvars.json in the working directory; this mechanism is useful when the job is to load a conventional set of root-module variable assignments automatically, whereas the current scenario requires the engineer to compute and reuse a derived expression without asking callers to supply it. These operations have different effects in the stated Terraform workflow.
D:The -var-file flag explicitly selects a variables file rather than relying on auto-loaded naming conventions; this mechanism is useful when the job is to load a nonstandard variable file selected for one environment, whereas the current scenario requires the engineer to compute and reuse a derived expression without asking callers to supply it. These operations have different effects in the stated Terraform workflow.
Question 502
A Terraform change proposal names “A data source block” to look up an already existing object without taking ownership of its lifecycle. Which outcome can reviewers attribute to that particular mechanism?
- When a managed resource is absent from configuration but still tracked in state, normal planning proposes its destruction.
- References to data.TYPE.NAME.attribute retrieve values supplied by a read-only provider data source.
- A resource type name usually starts with its provider local name, such as aws_instance for the AWS provider.
- A data block asks a provider to read information and does not make Terraform create or destroy the referenced remote object.
Explanation
Correct Answer
D:The named mechanism is used when the objective is to look up an already existing object without taking ownership of its lifecycle, so it produces the behavior described. In contrast, a data-source reference serves a different goal: use attributes read from an existing resource when configuring a new managed object, not look up an already existing object without taking ownership of its lifecycle.
Incorrect Answers
A:The description applies to removing a resource declaration when an engineer needs to plan to delete a previously managed object that remains in state; the named a data source block instead handles the requirement to look up an already existing object without taking ownership of its lifecycle, so this behavior does not describe A data source block in the situation named.
B:The description applies to a data-source reference when an engineer needs to use attributes read from an existing resource when configuring a new managed object; the named a data source block instead handles the requirement to look up an already existing object without taking ownership of its lifecycle, so this behavior does not describe A data source block in the situation named.
C:The description applies to provider resource type prefixes when an engineer needs to identify which provider implements a resource's API operations; the named a data source block instead handles the requirement to look up an already existing object without taking ownership of its lifecycle, so this behavior does not describe A data source block in the situation named.
Question 503
Reviewers reject “terraform providers lock” as a way to restrict the Terraform CLI version rather than a provider plugin. Which actual behavior explains why the proposal is unsuitable?
- The providers lock subcommand updates dependency lock information, including hashes for specified target operating-system platforms.
- The source address identifies a provider by registry hostname, namespace and type; local names alone are insufficient to distinguish publishers.
- The terraform block's required_version expression constrains which Terraform executable can operate on the configuration.
- The pessimistic constraint ~> 5.3 permits version 5.3 and later releases below 6.0.0.
Explanation
Correct Answer
A:terraform providers lock is used when an operator needs to populate provider package checksums for selected platforms. Consequently, this choice cannot meet the separate requirement to restrict the Terraform CLI version rather than a provider plugin. The intended action would instead require The required_version setting.
Incorrect Answers
B:This behavior belongs to A provider source address, which helps engineers distinguish a community plugin from the HashiCorp-maintained plugin with the same local name rather than satisfying the separate requirement to restrict the Terraform CLI version rather than a provider plugin. The attempted technique was terraform providers lock; it would instead be used to populate provider package checksums for selected platforms, not to produce the effect associated with A provider source address.
C:That outcome belongs to The required_version setting, the mechanism that can restrict the Terraform CLI version rather than a provider plugin. The question concerns the engineer’s actual proposal, terraform providers lock; it is directed at populate provider package checksums for selected platforms, not that result.
D:This behavior belongs to A major-series compatible constraint, which helps engineers accept minor and patch updates without crossing the next major version rather than satisfying the separate requirement to restrict the Terraform CLI version rather than a provider plugin. The attempted technique was terraform providers lock; it would instead be used to populate provider package checksums for selected platforms, not to produce the effect associated with A major-series compatible constraint.
Question 504
An infrastructure drift investigation requires a way to confirm that a held lock is stale before attempting manual removal. Which Terraform approach most directly fulfills that request?
- Not disabling locking for speed
- Lock ownership verification
- Backend-specific lock support
- Lock release after completion
Explanation
Correct Answer
B:A lock may belong to another active run, so check its identity and run status rather than immediately forcing removal; this directly meets the requirement to confirm that a held lock is stale before attempting manual removal. By comparison, lock release after completion is intended to understand why a normal Terraform operation frees the lock, which is a different task from confirm that a held lock is stale before attempting manual removal.
Incorrect Answers
A:The -lock=false option bypasses locking safeguards and increases the risk of two runs writing inconsistent state; this mechanism is useful when the job is to avoid conflicting state updates during concurrent deployments, whereas the current scenario requires the engineer to confirm that a held lock is stale before attempting manual removal. These operations have different effects in the stated Terraform workflow.
C:Backend state locking behavior depends on the backend implementation; remote storage alone does not guarantee safe locking; this mechanism is useful when the job is to check whether a chosen remote backend actually offers state locking, whereas the current scenario requires the engineer to confirm that a held lock is stale before attempting manual removal. These operations have different effects in the stated Terraform workflow.
D:Terraform obtains and releases supported backend locks around state-sensitive operations; a crash can sometimes leave manual recovery necessary; this mechanism is useful when the job is to understand why a normal Terraform operation frees the lock, whereas the current scenario requires the engineer to confirm that a held lock is stale before attempting manual removal. These operations have different effects in the stated Terraform workflow.
Question 505
During one infrastructure delivery, the team must satisfy all of the following: (1) allow compatible patch updates within a module's minor release series; (2) download a community module published with an official registry address. Select TWO appropriate Terraform approaches. Choose TWO.
- terraform get
- A public registry module source
- An absolute local module source
- Init -upgrade for registry modules
- The double-slash source subdirectory
- A pessimistic module version constraint
Explanation
Correct Answers
B:Registry module sources use the namespace/name/provider address form and can support a separate version argument; this meets the requirement to download a community module published with an official registry address, while the other selected techniques address allow compatible patch updates within a module's minor release series, which require their own distinct Terraform mechanisms.
F:A module version ~> 2.1.0 permits 2.1.x releases but excludes 2.2.0 and later; this meets the requirement to allow compatible patch updates within a module's minor release series, while the other selected techniques address download a community module published with an official registry address, which require their own distinct Terraform mechanisms.
Incorrect Answers
A:The terraform get command updates downloaded module sources only; routine workflows generally prefer terraform init; it addresses retrieve child modules without running the complete backend and provider setup steps, but this delivery instead requires allow compatible patch updates within a module's minor release series and download a community module published with an official registry address. The required combination involves A public registry module source and A pessimistic module version constraint, not the behavior of terraform get.
C:Terraform can load a module from a local filesystem path, though absolute paths make configurations less portable; it addresses call a child module from an explicit filesystem path, but this delivery instead requires allow compatible patch updates within a module's minor release series and download a community module published with an official registry address. The required combination involves A public registry module source and A pessimistic module version constraint, not the behavior of An absolute local module source.
D:The upgrade mode reselects module versions subject to constraints instead of automatically keeping the previously installed copy; it addresses consider newer published module releases already allowed by a version constraint, but this delivery instead requires allow compatible patch updates within a module's minor release series and download a community module published with an official registry address. The required combination involves A public registry module source and A pessimistic module version constraint, not the behavior of Init -upgrade for registry modules.
E:Module source syntax places //subdir after the package address to select the intended directory within the downloaded package; it addresses use a nested module stored below a repository's root directory, but this delivery instead requires allow compatible patch updates within a module's minor release series and download a community module published with an official registry address. The required combination involves A public registry module source and A pessimistic module version constraint, not the behavior of The double-slash source subdirectory.
Question 506
During a design review, the requirement is to understand why a normal Terraform operation frees the lock. Which option should the engineer select?
- HCP Terraform run serialization
- Not disabling locking for speed
- Lock ownership verification
- Lock release after completion
- Backend-specific lock support
Explanation
Correct Answer
D:Terraform obtains and releases supported backend locks around state-sensitive operations; a crash can sometimes leave manual recovery necessary; this directly meets the requirement to understand why a normal Terraform operation frees the lock. By comparison, not disabling locking for speed is intended to avoid conflicting state updates during concurrent deployments, which is a different task from understand why a normal Terraform operation frees the lock.
Incorrect Answers
A:HCP Terraform coordinates workspace runs and state handling, reducing conflicts among collaborating operators; this mechanism is useful when the job is to avoid multiple infrastructure applies targeting the same shared HCP workspace state, whereas the current scenario requires the engineer to understand why a normal Terraform operation frees the lock. These operations have different effects in the stated Terraform workflow.
B:The -lock=false option bypasses locking safeguards and increases the risk of two runs writing inconsistent state; this mechanism is useful when the job is to avoid conflicting state updates during concurrent deployments, whereas the current scenario requires the engineer to understand why a normal Terraform operation frees the lock. These operations have different effects in the stated Terraform workflow.
C:A lock may belong to another active run, so check its identity and run status rather than immediately forcing removal; this mechanism is useful when the job is to confirm that a held lock is stale before attempting manual removal, whereas the current scenario requires the engineer to understand why a normal Terraform operation frees the lock. These operations have different effects in the stated Terraform workflow.
E:Backend state locking behavior depends on the backend implementation; remote storage alone does not guarantee safe locking; this mechanism is useful when the job is to check whether a chosen remote backend actually offers state locking, whereas the current scenario requires the engineer to understand why a normal Terraform operation frees the lock. These operations have different effects in the stated Terraform workflow.
Question 507
An engineering checklist calls for separate outcomes: (1) allow independent resources to be applied concurrently; (2) run initialization again in an already prepared directory without unnecessary changes. Which TWO options implement the requested outcomes? Choose TWO.
- terraform init for a new directory
- Apply failure recovery
- Parallel graph execution
- Apply with a .tfvars file
- Repeatable initialization
Explanation
Correct Answers
C:Terraform executes actions in graph order and can operate on independent nodes in parallel subject to provider and CLI limits; this meets the requirement to allow independent resources to be applied concurrently, while the other selected techniques address run initialization again in an already prepared directory without unnecessary changes, which require their own distinct Terraform mechanisms.
E:terraform init is designed to be safely rerun; when requirements are unchanged, it generally keeps existing setup; this meets the requirement to run initialization again in an already prepared directory without unnecessary changes, while the other selected techniques address allow independent resources to be applied concurrently, which require their own distinct Terraform mechanisms.
Incorrect Answers
A:Initialization installs required providers and modules and establishes the working directory's backend configuration; it addresses prepare a folder containing fresh .tf configuration files, but this delivery instead requires allow independent resources to be applied concurrently and run initialization again in an already prepared directory without unnecessary changes. The required combination involves Repeatable initialization and Parallel graph execution, not the behavior of terraform init for a new directory.
B:A partial apply may have changed some resources, so Terraform should refresh and build a new plan rather than blindly assuming a full rollback; it addresses inspect state and re-plan when a provider operation fails partway through, but this delivery instead requires allow independent resources to be applied concurrently and run initialization again in an already prepared directory without unnecessary changes. The required combination involves Repeatable initialization and Parallel graph execution, not the behavior of Apply failure recovery.
D:The -var-file option loads values from an input variables file, enabling separate environment assignments; it addresses supply a named collection of input assignments to Terraform, but this delivery instead requires allow independent resources to be applied concurrently and run initialization again in an already prepared directory without unnecessary changes. The required combination involves Repeatable initialization and Parallel graph execution, not the behavior of Apply with a .tfvars file.
Question 508
Reviewers reject “A local backend path setting” as a way to recognize why ephemeral build agents should not rely on a machine-local state file. Which actual behavior explains why the proposal is unsuitable?
- A temporary runner may lose its filesystem after a job, so durable shared state is usually needed for repeatable team automation.
- The local backend supports a path argument for where the state file is stored on disk.
- Terraform commonly writes backup snapshots for local state updates, but backups require the same confidentiality controls as state.
- Local files do not provide an organization-wide shared state or distributed locking comparable to an appropriately configured remote backend.
Explanation
Correct Answer
B:A local backend path setting is used when an operator needs to save the default workspace state to a nondefault local filename. Consequently, this choice cannot meet the separate requirement to recognize why ephemeral build agents should not rely on a machine-local state file. The intended action would instead require Local state in CI.
Incorrect Answers
A:That outcome belongs to Local state in CI, the mechanism that can recognize why ephemeral build agents should not rely on a machine-local state file. The question concerns the engineer’s actual proposal, A local backend path setting; it is directed at save the default workspace state to a nondefault local filename, not that result.
C:This behavior belongs to A local state backup file, which helps engineers recover from a state change without relying solely on an unversioned primary file rather than satisfying the separate requirement to recognize why ephemeral build agents should not rely on a machine-local state file. The attempted technique was A local backend path setting; it would instead be used to save the default workspace state to a nondefault local filename, not to produce the effect associated with A local state backup file.
D:This behavior belongs to The local backend's lack of team collaboration features, which helps engineers avoid concurrent writes from multiple operators on different machines rather than satisfying the separate requirement to recognize why ephemeral build agents should not rely on a machine-local state file. The attempted technique was A local backend path setting; it would instead be used to save the default workspace state to a nondefault local filename, not to produce the effect associated with The local backend's lack of team collaboration features.
Question 509
During one infrastructure delivery, the team must satisfy all of the following: (1) instantiate a fixed number of child module copies; (2) pass a structured settings bundle into a reusable module. Select TWO appropriate Terraform approaches. Choose TWO.
- Input object variables
- Nested module output propagation
- A module with count
- A variable default inside a child
- Using a module registry version
Explanation
Correct Answers
A:An object type lets a module enforce named configuration fields instead of accepting many untyped values; this meets the requirement to pass a structured settings bundle into a reusable module, while the other selected techniques address instantiate a fixed number of child module copies, which require their own distinct Terraform mechanisms.
C:The count meta-argument creates numerically indexed module instances such as module.worker[0]; this meets the requirement to instantiate a fixed number of child module copies, while the other selected techniques address pass a structured settings bundle into a reusable module, which require their own distinct Terraform mechanisms.
Incorrect Answers
B:Each module boundary needs an output passthrough because the root cannot directly access an arbitrary grandchild's private resources; it addresses make a value from a grandchild module visible to the root module, but this delivery instead requires instantiate a fixed number of child module copies and pass a structured settings bundle into a reusable module. The required combination involves Input object variables and A module with count, not the behavior of Nested module output propagation.
D:A default inside the child variable declaration applies when the caller omits that module argument; it addresses make a module input optional when callers do not require customization, but this delivery instead requires instantiate a fixed number of child module copies and pass a structured settings bundle into a reusable module. The required combination involves Input object variables and A module with count, not the behavior of A variable default inside a child.
E:The module block's version argument can constrain registry modules and is separate from Terraform CLI and provider version settings; it addresses control which published module release a root configuration consumes, but this delivery instead requires instantiate a fixed number of child module copies and pass a structured settings bundle into a reusable module. The required combination involves Input object variables and A module with count, not the behavior of Using a module registry version.
Question 510
A platform standardization effort has a concrete implementation goal: determine a safe sequence for creating objects with references between them. What is the most appropriate Terraform mechanism?
- Desired-state reconciliation
- A resource graph
- Declarative resource configuration
- Repeatable environment definition
Explanation
Correct Answer
B:Terraform derives dependency edges from references, using the graph to order dependent changes and permit safe parallel operations; this directly meets the requirement to determine a safe sequence for creating objects with references between them. By comparison, declarative resource configuration is intended to describe the desired infrastructure state instead of scripting every API step, which is a different task from determine a safe sequence for creating objects with references between them.
Incorrect Answers
A:Planning compares configuration with state and refreshed remote data to propose actions that reconcile differences; this mechanism is useful when the job is to identify changes between the declared configuration and managed infrastructure, whereas the current scenario requires the engineer to determine a safe sequence for creating objects with references between them. These operations have different effects in the stated Terraform workflow.
C:Terraform interprets resource declarations, constructs a dependency graph, and asks providers to reconcile real objects with that desired state; this mechanism is useful when the job is to describe the desired infrastructure state instead of scripting every API step, whereas the current scenario requires the engineer to determine a safe sequence for creating objects with references between them. These operations have different effects in the stated Terraform workflow.
D:IaC configuration provides repeatable definitions; variables and isolated state allow environments to differ without independently hand-building each object; this mechanism is useful when the job is to recreate the same logical infrastructure design across test and production, whereas the current scenario requires the engineer to determine a safe sequence for creating objects with references between them. These operations have different effects in the stated Terraform workflow.