Question 670
During an infrastructure design review about how to consider newer published module releases already allowed by a version constraint, a maintainer asks what “Init -upgrade for registry modules” does. Which description is accurate?
- The upgrade mode reselects module versions subject to constraints instead of automatically keeping the previously installed copy.
- A module upgrade can change resource definitions and outputs, so the consumer should inspect the new source and resulting Terraform plan.
- The module version argument accepts version constraints for registry sources and Terraform resolves compatible published releases during init.
- A module version constraint such as = 2.1.3 selects only that published version until the requirement changes.
- A Git module's ?ref= tag or commit selects a repository revision instead of a registry module version constraint.
Explanation
Correct Answer
A:The named mechanism is used when the objective is to consider newer published module releases already allowed by a version constraint, so it produces the behavior described. In contrast, a registry module version constraint serves a different goal: select a supported module release range from the registry, not consider newer published module releases already allowed by a version constraint.
Incorrect Answers
B:The description applies to reviewing module upgrade changes when an engineer needs to control behavioral changes after moving to a new module release; the named init -upgrade for registry modules instead handles the requirement to consider newer published module releases already allowed by a version constraint, so this behavior does not describe Init -upgrade for registry modules in the situation named.
C:The description applies to a registry module version constraint when an engineer needs to select a supported module release range from the registry; the named init -upgrade for registry modules instead handles the requirement to consider newer published module releases already allowed by a version constraint, so this behavior does not describe Init -upgrade for registry modules in the situation named.
D:The description applies to a strict registry module pin when an engineer needs to reproduce a vetted module release without automatically selecting a newer one; the named init -upgrade for registry modules instead handles the requirement to consider newer published module releases already allowed by a version constraint, so this behavior does not describe Init -upgrade for registry modules in the situation named.
E:The description applies to a Git tag pin for a module when an engineer needs to select a specific VCS module release without using a registry version argument; the named init -upgrade for registry modules instead handles the requirement to consider newer published module releases already allowed by a version constraint, so this behavior does not describe Init -upgrade for registry modules in the situation named.
Question 671
A team proposes “State file confidentiality” to move an established project to remote state without abandoning resource identity. If they proceed with that technique, which result should they anticipate instead?
- Backend configuration is evaluated for the root module; defining backend settings inside reusable child modules does not give them separate state.
- Changing the root backend and running init -migrate-state can transfer the existing snapshot to the newly configured destination.
- Terraform commonly writes backup snapshots for local state updates, but backups require the same confidentiality controls as state.
- Local state can hold raw provider attributes and secrets, so filesystem access controls and encryption matter.
Explanation
Correct Answer
D:State file confidentiality is used when an operator needs to protect a workstation's local state file even when output values are hidden. Consequently, this choice cannot meet the separate requirement to move an established project to remote state without abandoning resource identity. The intended action would instead require State migration from local storage.
Incorrect Answers
A:This behavior belongs to Backend configuration only in a root module, which helps engineers choose where a root deployment's state will be stored rather than satisfying the separate requirement to move an established project to remote state without abandoning resource identity. The attempted technique was State file confidentiality; it would instead be used to protect a workstation's local state file even when output values are hidden, not to produce the effect associated with Backend configuration only in a root module.
B:That outcome belongs to State migration from local storage, the mechanism that can move an established project to remote state without abandoning resource identity. The question concerns the engineer’s actual proposal, State file confidentiality; it is directed at protect a workstation's local state file even when output values are hidden, 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 move an established project to remote state without abandoning resource identity. The attempted technique was State file confidentiality; it would instead be used to protect a workstation's local state file even when output values are hidden, not to produce the effect associated with A local state backup file.
Question 672
A pipeline responsible for the Terraform workflow needs to prepare a newly cloned root module for local Terraform operations. Which feature or operation is the most direct match?
- Iterate after feedback
- Initialize after checkout
- Separate plan and apply privileges
- Check infrastructure after apply
- Write configuration first
Explanation
Correct Answer
B:Running terraform init configures backend access, child modules and required providers before plans can run; this directly meets the requirement to prepare a newly cloned root module for local Terraform operations. By comparison, separate plan and apply privileges is intended to require approval before an infrastructure change executes, which is a different task from prepare a newly cloned root module for local Terraform operations.
Incorrect Answers
A:A revised configuration must be planned again because a prior plan does not automatically incorporate later edits; this mechanism is useful when the job is to modify and re-plan after a change request is rejected, whereas the current scenario requires the engineer to prepare a newly cloned root module for local Terraform operations. These operations have different effects in the stated Terraform workflow.
C:Teams can make planning a review step and reserve apply execution for an authorized operator or HCP Terraform run; this mechanism is useful when the job is to require approval before an infrastructure change executes, whereas the current scenario requires the engineer to prepare a newly cloned root module for local Terraform operations. These operations have different effects in the stated Terraform workflow.
D:Following apply, output values and state inspection can reveal created identifiers while a new plan can test for remaining drift; this mechanism is useful when the job is to confirm deployed outputs and state match the expected result, whereas the current scenario requires the engineer to prepare a newly cloned root module for local Terraform operations. These operations have different effects in the stated Terraform workflow.
E:The workflow begins by declaring resources, inputs and dependencies that describe what Terraform should manage; this mechanism is useful when the job is to express the intended infrastructure before asking Terraform for a plan, whereas the current scenario requires the engineer to prepare a newly cloned root module for local Terraform operations. These operations have different effects in the stated Terraform workflow.
Question 673
A change request asks an engineer to block a destructive plan for a protected configured resource. Which choice best implements the requested behavior?
- An explicit prevent_destroy rule
- Remove from state without deletion
- terraform plan -destroy
- terraform destroy
- Destroy plan risk review
Explanation
Correct Answer
A:The lifecycle prevent_destroy setting rejects a plan that destroys or replaces a configured resource while the rule remains present; this directly meets the requirement to block a destructive plan for a protected configured resource. By comparison, terraform destroy is intended to remove the managed infrastructure described by the current Terraform configuration, which is a different task from block a destructive plan for a protected configured resource.
Incorrect Answers
B:Removing a state association, for example with terraform state rm, makes Terraform forget the object without asking the provider to delete it; this mechanism is useful when the job is to stop managing an existing object while preserving the real remote infrastructure, whereas the current scenario requires the engineer to block a destructive plan for a protected configured resource. These operations have different effects in the stated Terraform workflow.
C:Destroy planning shows the deletion proposal without carrying out the deletion until apply; this mechanism is useful when the job is to review an all-destroy plan before approving resource deletion, whereas the current scenario requires the engineer to block a destructive plan for a protected configured resource. These operations have different effects in the stated Terraform workflow.
D:The destroy command plans and applies removal of managed objects subject to lifecycle and provider constraints; this mechanism is useful when the job is to remove the managed infrastructure described by the current Terraform configuration, whereas the current scenario requires the engineer to block a destructive plan for a protected configured resource. These operations have different effects in the stated Terraform workflow.
E:Reviewing a destroy plan is essential because a command can remove every managed instance within the relevant state scope; this mechanism is useful when the job is to identify which root-module-managed resources will be affected before a cleanup, whereas the current scenario requires the engineer to block a destructive plan for a protected configured resource. These operations have different effects in the stated Terraform workflow.
Question 674
A team compares Terraform mechanisms for the goal to focus verbose diagnostics on Terraform Core rather than all plugin activity. Which stated consequence belongs specifically to “TF_LOG_CORE”?
- High verbosity creates large logs and greater secret-exposure risk; enable it for a specific incident and disable it afterward.
- The TF_LOG_CORE variable can control log verbosity for Core messages independently of general logging.
- Terraform diagnostic logs can include sensitive data, so access control and careful review are required before sharing them.
- The TF_LOG_PROVIDER setting controls provider log verbosity and can help locate failures involving provider communication.
Explanation
Correct Answer
B:The named mechanism is used when the objective is to focus verbose diagnostics on Terraform Core rather than all plugin activity, so it produces the behavior described. In contrast, redacting shared diagnostic logs serves a different goal: prevent troubleshooting output from leaking credentials or resource attributes, not focus verbose diagnostics on Terraform Core rather than all plugin activity.
Incorrect Answers
A:The description applies to verbose logging only during diagnosis when an engineer needs to avoid permanent trace logs in normal automated runs; the named TF_LOG_CORE instead handles the requirement to focus verbose diagnostics on Terraform Core rather than all plugin activity, so this behavior does not describe TF_LOG_CORE in the situation named.
C:The description applies to redacting shared diagnostic logs when an engineer needs to prevent troubleshooting output from leaking credentials or resource attributes; the named TF_LOG_CORE instead handles the requirement to focus verbose diagnostics on Terraform Core rather than all plugin activity, so this behavior does not describe TF_LOG_CORE in the situation named.
D:The description applies to TF_LOG_PROVIDER when an engineer needs to isolate provider-related diagnostic output during API troubleshooting; the named TF_LOG_CORE instead handles the requirement to focus verbose diagnostics on Terraform Core rather than all plugin activity, so this behavior does not describe TF_LOG_CORE in the situation named.
Question 675
A change request asks an engineer to interpret the leading + symbol in Terraform's plan. Which choice best implements the requested behavior?
- terraform plan -refresh=false
- A resource action marked plus
- The dependency graph during planning
- terraform plan -replace
Explanation
Correct Answer
B:In conventional human-readable plans, + signifies that a managed resource is proposed for creation; this directly meets the requirement to interpret the leading + symbol in Terraform's 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 interpret the leading + symbol in Terraform's plan.
Incorrect Answers
A:Disabling refresh reduces remote reads but can hide drift and produce an inaccurate plan based on stale observations; this mechanism is useful when the job is to skip routine state refresh for a constrained preview, whereas the current scenario requires the engineer to interpret the leading + symbol in Terraform's plan. These operations have different effects in the stated Terraform workflow.
C: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 interpret the leading + symbol in Terraform's plan. These operations have different effects in the stated Terraform workflow.
D:The -replace=ADDRESS option requests replacement of a particular managed instance even if ordinary change detection would update it in place or do nothing; this mechanism is useful when the job is to force a resource instance to be replaced during planning, whereas the current scenario requires the engineer to interpret the leading + symbol in Terraform's plan. These operations have different effects in the stated Terraform workflow.
Question 676
An engineer preparing an infrastructure rollout requires a way to detect invalid configuration even when no cloud changes should occur. Which Terraform approach most directly fulfills that request?
- Validate without live deployment
- Missing required argument detection
- Validate after init
- A type mismatch diagnosis
Explanation
Correct Answer
A:terraform validate runs offline-oriented configuration checks and does not deploy managed resources; this directly meets the requirement to detect invalid configuration even when no cloud changes should occur. By comparison, a type mismatch diagnosis is intended to catch an argument whose expression does not match the provider schema, which is a different task from detect invalid configuration even when no cloud changes should occur.
Incorrect Answers
B:Validation compares configuration with provider schemas and reports missing required fields; this mechanism is useful when the job is to catch a resource block lacking a mandatory argument, whereas the current scenario requires the engineer to detect invalid configuration even when no cloud changes should occur. These operations have different effects in the stated Terraform workflow.
C:Because validate consults provider and module definitions, run init first to install referenced dependencies; this mechanism is useful when the job is to resolve missing provider schemas before checking configuration, whereas the current scenario requires the engineer to detect invalid configuration even when no cloud changes should occur. These operations have different effects in the stated Terraform workflow.
D:Provider schemas and Terraform's type checking can make validate fail before an apply is attempted; this mechanism is useful when the job is to catch an argument whose expression does not match the provider schema, whereas the current scenario requires the engineer to detect invalid configuration even when no cloud changes should occur. These operations have different effects in the stated Terraform workflow.
Question 677
An engineer proposes “Provider data refresh” to read information from an external service without owning its lifecycle. Which outcome does the proposed technique actually provide?
- A provider's data source reads existing data and exposes attributes without creating or destroying the queried object.
- Terraform generally selects the default provider matching a resource's type prefix unless an alternate configuration is specified.
- A provider configuration with alias defines a named alternate that resources or modules can explicitly select.
- Providers retrieve object details so Terraform can compare observed infrastructure against desired configuration and prior state.
Explanation
Correct Answer
D:Provider data refresh is used when an operator needs to read current attributes of managed remote objects during planning. Consequently, this choice cannot meet the separate requirement to read information from an external service without owning its lifecycle. The intended action would instead require Provider-defined data sources.
Incorrect Answers
A:That outcome belongs to Provider-defined data sources, the mechanism that can read information from an external service without owning its lifecycle. The question concerns the engineer’s actual proposal, Provider data refresh; it is directed at read current attributes of managed remote objects during planning, not that result.
B:This behavior belongs to Implicit provider selection, which helps engineers use the default provider configuration for a resource type rather than satisfying the separate requirement to read information from an external service without owning its lifecycle. The attempted technique was Provider data refresh; it would instead be used to read current attributes of managed remote objects during planning, not to produce the effect associated with Implicit provider selection.
C:This behavior belongs to Provider aliases, which helps engineers configure two connections to the same service for different regions or accounts rather than satisfying the separate requirement to read information from an external service without owning its lifecycle. The attempted technique was Provider data refresh; it would instead be used to read current attributes of managed remote objects during planning, not to produce the effect associated with Provider aliases.
Question 678
A team compares Terraform mechanisms for the goal to convert a delimiter-separated string into a list. Which stated consequence belongs specifically to “The split function”?
- dynamic constructs blocks required by resource schemas; it does not create standalone Terraform resource declarations.
- lookup(map, key, default) retrieves the selected key's value or the supplied default if the key does not exist.
- split divides a string at a delimiter and returns its constituent substrings.
- merge overlays object or map arguments and chooses the value from the last argument containing a duplicate key.
- cidrsubnet derives a subnet CIDR using additional prefix bits and a network number, without provisioning a network resource.
Explanation
Correct Answer
C:The named mechanism is used when the objective is to convert a delimiter-separated string into a list, so it produces the behavior described. In contrast, the lookup function serves a different goal: read a map element and provide a fallback when the key is absent, not convert a delimiter-separated string into a list.
Incorrect Answers
A:The description applies to the dynamic block when an engineer needs to generate repeated nested blocks from a collection; the named the split function instead handles the requirement to convert a delimiter-separated string into a list, so this behavior does not describe The split function in the situation named.
B:The description applies to the lookup function when an engineer needs to read a map element and provide a fallback when the key is absent; the named the split function instead handles the requirement to convert a delimiter-separated string into a list, so this behavior does not describe The split function in the situation named.
D:The description applies to the merge function when an engineer needs to combine maps with later values overriding earlier keys; the named the split function instead handles the requirement to convert a delimiter-separated string into a list, so this behavior does not describe The split function in the situation named.
E:The description applies to the cidrsubnet function when an engineer needs to calculate a nested network prefix from a parent CIDR range; the named the split function instead handles the requirement to convert a delimiter-separated string into a list, so this behavior does not describe The split function in the situation named.
Question 679
A change request asks an engineer to reject an execution plan that deletes a protected configured object. Which choice best implements the requested behavior?
- prevent_destroy
- Dependency cycle resolution
- ignore_changes = all
- terraform_data as a replacement trigger
Explanation
Correct Answer
A:The lifecycle rule prevents destruction or replacement while it remains declared on the resource; removing its block removes that protection; this directly meets the requirement to reject an execution plan that deletes a protected configured object. By comparison, ignore_changes = all is intended to disable updates to all managed resource attributes after creation, which is a different task from reject an execution plan that deletes a protected configured object.
Incorrect Answers
B:Dependency cycles cannot be topologically ordered and require restructuring the relationships or splitting responsibilities; this mechanism is useful when the job is to correct a pair of modules that each require the other's output to initialize, whereas the current scenario requires the engineer to reject an execution plan that deletes a protected configured object. These operations have different effects in the stated Terraform workflow.
C:With all attributes ignored during updates, Terraform can still create and destroy the resource but does not reconcile field-level changes; this mechanism is useful when the job is to disable updates to all managed resource attributes after creation, whereas the current scenario requires the engineer to reject an execution plan that deletes a protected configured object. These operations have different effects in the stated Terraform workflow.
D:A terraform_data resource can expose input-related lifecycle actions for replace_triggered_by, which expects managed resource changes; this mechanism is useful when the job is to trigger replacement from a plain variable value change, whereas the current scenario requires the engineer to reject an execution plan that deletes a protected configured object. These operations have different effects in the stated Terraform workflow.
Question 680
During a design review, the requirement is to restrict the Terraform CLI version rather than a provider plugin. Which option should the engineer select?
- terraform init
- A major-series compatible constraint
- The required_version setting
- The dependency lock file
Explanation
Correct Answer
C:The terraform block's required_version expression constrains which Terraform executable can operate on the configuration; this directly meets the requirement to restrict the Terraform CLI version rather than a provider plugin. By comparison, the dependency lock file is intended to reproduce previously selected provider package versions on other machines, which is a different task from restrict the Terraform CLI version rather than a provider plugin.
Incorrect Answers
A:Initialization resolves provider requirements, installs plugins, and prepares modules and backend settings in the working directory; this mechanism is useful when the job is to download missing required provider plugins before planning, whereas the current scenario requires the engineer to restrict the Terraform CLI version rather than a provider plugin. These operations have different effects in the stated Terraform workflow.
B:The pessimistic constraint ~> 5.3 permits version 5.3 and later releases below 6.0.0; this mechanism is useful when the job is to accept minor and patch updates without crossing the next major version, whereas the current scenario requires the engineer to restrict the Terraform CLI version rather than a provider plugin. These operations have different effects in the stated Terraform workflow.
D:The .terraform.lock.hcl file records selected provider versions and checksums to constrain subsequent installations; this mechanism is useful when the job is to reproduce previously selected provider package versions on other machines, whereas the current scenario requires the engineer to restrict the Terraform CLI version rather than a provider plugin. These operations have different effects in the stated Terraform workflow.