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.
Question 681
During a design review, the requirement is to combine maps with later values overriding earlier keys. Which option should the engineer select?
- The ternary conditional operator
- The merge function
- The dynamic block
- The cidrsubnet function
Explanation
Correct Answer
B:merge overlays object or map arguments and chooses the value from the last argument containing a duplicate key; this directly meets the requirement to combine maps with later values overriding earlier keys. By comparison, the dynamic block is intended to generate repeated nested blocks from a collection, which is a different task from combine maps with later values overriding earlier keys.
Incorrect Answers
A:The condition ? value_a : value_b expression chooses a suitable branch without creating duplicate resource blocks; this mechanism is useful when the job is to set a resource argument according to a boolean expression, whereas the current scenario requires the engineer to combine maps with later values overriding earlier keys. These operations have different effects in the stated Terraform workflow.
C:dynamic constructs blocks required by resource schemas; it does not create standalone Terraform resource declarations; this mechanism is useful when the job is to generate repeated nested blocks from a collection, whereas the current scenario requires the engineer to combine maps with later values overriding earlier keys. These operations have different effects in the stated Terraform workflow.
D:cidrsubnet derives a subnet CIDR using additional prefix bits and a network number, without provisioning a network resource; this mechanism is useful when the job is to calculate a nested network prefix from a parent CIDR range, whereas the current scenario requires the engineer to combine maps with later values overriding earlier keys. These operations have different effects in the stated Terraform workflow.
Question 682
An engineer intends to declare that a resource should leave management while its actual object is retained and is reviewing “A removed block with destroy=false”. What consequence follows from using it as intended?
- Providers refresh remote resource attributes, and planning can propose updates to bring changed objects back to declared configuration.
- The lifecycle ignore_changes rule suppresses post-creation update plans for selected attributes while leaving other attributes managed.
- Configuration still describes the preferred value, so normal planning can propose undoing an out-of-band modification unless ignored.
- A removed block can intentionally forget the previous resource address without a provider delete when lifecycle destroy is false.
Explanation
Correct Answer
D:The named mechanism is used when the objective is to declare that a resource should leave management while its actual object is retained, so it produces the behavior described. In contrast, a refreshed changed resource serves a different goal: understand why Terraform tries to reset a manually edited resource attribute, not declare that a resource should leave management while its actual object is retained.
Incorrect Answers
A:The description applies to a normal plan with drift when an engineer needs to detect and propose correction for changes made outside Terraform; the named a removed block with destroy=false instead handles the requirement to declare that a resource should leave management while its actual object is retained, so this behavior does not describe A removed block with destroy=false in the situation named.
B:The description applies to ignore_changes for shared ownership when an engineer needs to stop Terraform from overwriting a field delegated to an external controller; the named a removed block with destroy=false instead handles the requirement to declare that a resource should leave management while its actual object is retained, so this behavior does not describe A removed block with destroy=false in the situation named.
C:The description applies to a refreshed changed resource when an engineer needs to understand why Terraform tries to reset a manually edited resource attribute; the named a removed block with destroy=false instead handles the requirement to declare that a resource should leave management while its actual object is retained, so this behavior does not describe A removed block with destroy=false in the situation named.
Question 683
A Terraform change proposal names “Cross-provider references” to link an output from one service to a dependent resource on another service. Which outcome can reviewers attribute to that particular mechanism?
- Terraform can install different providers and let each manage its own service API within a single graph.
- An attribute reference between resource instances can create a dependency across provider boundaries.
- A shared Terraform language does not erase provider API differences; each provider defines supported resource schemas and behavior.
- Providers can represent both on-premises platforms and cloud services as Terraform-managed resources in one workflow.
Explanation
Correct Answer
B:The named mechanism is used when the objective is to link an output from one service to a dependent resource on another service, so it produces the behavior described. In contrast, hybrid infrastructure provisioning serves a different goal: coordinate an on-premises platform with public-cloud resources, not link an output from one service to a dependent resource on another service.
Incorrect Answers
A:The description applies to multiple provider requirements when an engineer needs to manage cloud resources and SaaS resources in one configuration; the named cross-provider references instead handles the requirement to link an output from one service to a dependent resource on another service, so this behavior does not describe Cross-provider references in the situation named.
C:The description applies to provider-specific capabilities when an engineer needs to avoid assuming that all providers expose identical resource types and options; the named cross-provider references instead handles the requirement to link an output from one service to a dependent resource on another service, so this behavior does not describe Cross-provider references in the situation named.
D:The description applies to hybrid infrastructure provisioning when an engineer needs to coordinate an on-premises platform with public-cloud resources; the named cross-provider references instead handles the requirement to link an output from one service to a dependent resource on another service, so this behavior does not describe Cross-provider references in the situation named.
Question 684
A runbook lists “Consistent dependency management” for the task to avoid hand-sequencing every resource operation. Which technical effect should its description include?
- With no configuration or remote drift requiring action, a new plan normally proposes no infrastructure changes.
- A Terraform plan is a reviewable proposed set of actions; execution occurs only when an apply runs against the chosen plan.
- Terraform infers many dependencies from references and applies graph ordering to create or modify related resources safely.
- A version-control pull request can expose infrastructure edits to peer review, policy checks and automated validation.
Explanation
Correct Answer
C:The named mechanism is used when the objective is to avoid hand-sequencing every resource operation, so it produces the behavior described. In contrast, idempotent convergence serves a different goal: run unchanged configuration repeatedly without inventing new infrastructure updates, not avoid hand-sequencing every resource operation.
Incorrect Answers
A:The description applies to idempotent convergence when an engineer needs to run unchanged configuration repeatedly without inventing new infrastructure updates; the named consistent dependency management instead handles the requirement to avoid hand-sequencing every resource operation, so this behavior does not describe Consistent dependency management in the situation named.
B:The description applies to plan-before-apply reviews when an engineer needs to see intended infrastructure changes without immediately creating them; the named consistent dependency management instead handles the requirement to avoid hand-sequencing every resource operation, so this behavior does not describe Consistent dependency management in the situation named.
D:The description applies to code review of infrastructure when an engineer needs to catch undesirable configuration changes before deployment; the named consistent dependency management instead handles the requirement to avoid hand-sequencing every resource operation, so this behavior does not describe Consistent dependency management in the situation named.
Question 685
An engineer preparing an infrastructure rollout needs to force a resource instance to be replaced during planning. Which feature or operation is the most direct match?
- A resource action marked minus
- terraform plan -replace
- terraform graph
- A resource action marked tilde
Explanation
Correct Answer
B: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 directly meets the requirement to force a resource instance to be replaced during planning. By comparison, a resource action marked tilde is intended to identify an in-place change rather than object recreation, which is a different task from force a resource instance to be replaced during planning.
Incorrect Answers
A:In human-readable plans, - denotes a planned destruction of a managed resource; this mechanism is useful when the job is to interpret a plan showing a resource that Terraform will destroy, whereas the current scenario requires the engineer to force a resource instance to be replaced during planning. These operations have different effects in the stated Terraform workflow.
C:The graph command emits a DOT graph representation of Terraform dependencies, useful for spotting unexpected ordering constraints; this mechanism is useful when the job is to display configuration and state dependencies for troubleshooting, whereas the current scenario requires the engineer to force a resource instance to be replaced during planning. These operations have different effects in the stated Terraform workflow.
D:In human-readable plan diffs, ~ indicates that Terraform proposes updating existing resource attributes; this mechanism is useful when the job is to identify an in-place change rather than object recreation, whereas the current scenario requires the engineer to force a resource instance to be replaced during planning. These operations have different effects in the stated Terraform workflow.
Question 686
A platform team separating infrastructure deployments has a concrete implementation goal: publish selected values produced by an HCP Terraform run. What is the most appropriate Terraform mechanism?
- The HCP run queue
- A run apply phase
- Workspace outputs
- A run plan phase
- HCP Terraform remote state
Explanation
Correct Answer
C:Workspace output values come from root module output blocks and can be consumed through supported interfaces; this directly meets the requirement to publish selected values produced by an HCP Terraform run. By comparison, the HCP run queue is intended to coordinate multiple requested changes against the same workspace state, which is a different task from publish selected values produced by an HCP Terraform run.
Incorrect Answers
A:Queued runs and workspace run management help serialize changes and avoid competing applies to one state; this mechanism is useful when the job is to coordinate multiple requested changes against the same workspace state, whereas the current scenario requires the engineer to publish selected values produced by an HCP Terraform run. These operations have different effects in the stated Terraform workflow.
B:HCP Terraform can run the apply stage after its configured approval, policy and workflow requirements are satisfied; this mechanism is useful when the job is to execute approved resource changes within an HCP Terraform workspace, whereas the current scenario requires the engineer to publish selected values produced by an HCP Terraform run. These operations have different effects in the stated Terraform workflow.
D:HCP Terraform runs have plan stages where proposed infrastructure operations can be inspected and checked; this mechanism is useful when the job is to review infrastructure differences before applying a workspace change, whereas the current scenario requires the engineer to publish selected values produced by an HCP Terraform run. These operations have different effects in the stated Terraform workflow.
E:HCP Terraform maintains workspace state versions and supports collaboration without exposing a machine-local canonical state file; this mechanism is useful when the job is to store Terraform state under managed service controls rather than a local file, whereas the current scenario requires the engineer to publish selected values produced by an HCP Terraform run. These operations have different effects in the stated Terraform workflow.
Question 687
A Terraform reviewer encounters “Redacting shared diagnostic logs” while assessing how to prevent troubleshooting output from leaking credentials or resource attributes. Which statement correctly describes its actual behavior?
- TF_LOG_PATH directs log output to a file and should be combined with an enabled TF_LOG level.
- High verbosity creates large logs and greater secret-exposure risk; enable it for a specific incident and disable it afterward.
- Terraform diagnostic logs can include sensitive data, so access control and careful review are required before sharing them.
- The TF_LOG_CORE variable can control log verbosity for Core messages independently of general logging.
- Unsetting or disabling Terraform's TF_LOG environment setting removes extra diagnostic verbosity from later commands.
Explanation
Correct Answer
C:The named mechanism is used when the objective is to prevent troubleshooting output from leaking credentials or resource attributes, so it produces the behavior described. In contrast, verbose logging only during diagnosis serves a different goal: avoid permanent trace logs in normal automated runs, not prevent troubleshooting output from leaking credentials or resource attributes.
Incorrect Answers
A:The description applies to TF_LOG_PATH when an engineer needs to save enabled Terraform diagnostic logs to a designated file; the named redacting shared diagnostic logs instead handles the requirement to prevent troubleshooting output from leaking credentials or resource attributes, so this behavior does not describe Redacting shared diagnostic logs in the situation named.
B:The description applies to verbose logging only during diagnosis when an engineer needs to avoid permanent trace logs in normal automated runs; the named redacting shared diagnostic logs instead handles the requirement to prevent troubleshooting output from leaking credentials or resource attributes, so this behavior does not describe Redacting shared diagnostic logs in the situation named.
D:The description applies to TF_LOG_CORE when an engineer needs to focus verbose diagnostics on Terraform Core rather than all plugin activity; the named redacting shared diagnostic logs instead handles the requirement to prevent troubleshooting output from leaking credentials or resource attributes, so this behavior does not describe Redacting shared diagnostic logs in the situation named.
E:The statement describes Disabling TF_LOG, which is appropriate when engineers need to return a shell session to ordinary Terraform logging after investigation; it does not explain Redacting shared diagnostic logs, the construct used to prevent troubleshooting output from leaking credentials or resource attributes. The two behaviors are separate.
Question 688
A platform engineering team maintaining plugins needs to retrieve a published plugin from its declared registry source. Which feature or operation is the most direct match?
- A major-series compatible constraint
- terraform init -upgrade
- terraform providers lock
- Provider registry installation
Explanation
Correct Answer
D:Terraform uses provider source metadata and its configured installation methods to find and install the appropriate plugin binary; this directly meets the requirement to retrieve a published plugin from its declared registry source. By comparison, terraform init -upgrade is intended to intentionally reconsider previously locked provider and module selections, which is a different task from retrieve a published plugin from its declared registry source.
Incorrect Answers
A: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 retrieve a published plugin from its declared registry source. These operations have different effects in the stated Terraform workflow.
B:The -upgrade switch permits newer versions that satisfy constraints instead of preserving current installed or locked selections; this mechanism is useful when the job is to intentionally reconsider previously locked provider and module selections, whereas the current scenario requires the engineer to retrieve a published plugin from its declared registry source. These operations have different effects in the stated Terraform workflow.
C:The providers lock subcommand updates dependency lock information, including hashes for specified target operating-system platforms; this mechanism is useful when the job is to populate provider package checksums for selected platforms, whereas the current scenario requires the engineer to retrieve a published plugin from its declared registry source. These operations have different effects in the stated Terraform workflow.
Question 689
An engineer intends to prevent staging changes from unintentionally sharing the production state mapping and is reviewing “Separate state per environment”. What consequence follows from using it as intended?
- Distinct backends, workspaces or root configurations can isolate state, but the configuration must target the intended instance set.
- State can retain dependency information needed to correctly destroy objects no longer declared in configuration.
- The state list command enumerates Terraform resource addresses without creating or deleting infrastructure.
- State may contain secret values even when CLI output is redacted, so storage encryption and access controls matter.
- A normal plan attempts to refresh state from providers before comparing objects to the current configuration.
- State metadata includes lineage and serial information that helps Terraform identify state history and updates.
Explanation
Correct Answer
A:The named mechanism is used when the objective is to prevent staging changes from unintentionally sharing the production state mapping, so it produces the behavior described. In contrast, state access protection serves a different goal: treat a Terraform state file as potentially sensitive data, not prevent staging changes from unintentionally sharing the production state mapping.
Incorrect Answers
B:The description applies to state-backed dependency links when an engineer needs to maintain dependencies for resources that have been removed from configuration; the named separate state per environment instead handles the requirement to prevent staging changes from unintentionally sharing the production state mapping, so this behavior does not describe Separate state per environment in the situation named.
C:The description applies to terraform state list when an engineer needs to inspect the addresses of instances currently tracked in state; the named separate state per environment instead handles the requirement to prevent staging changes from unintentionally sharing the production state mapping, so this behavior does not describe Separate state per environment in the situation named.
D:The description applies to state access protection when an engineer needs to treat a Terraform state file as potentially sensitive data; the named separate state per environment instead handles the requirement to prevent staging changes from unintentionally sharing the production state mapping, so this behavior does not describe Separate state per environment in the situation named.
E:The description applies to Terraform refresh during planning when an engineer needs to detect actual resource attributes rather than relying only on historical saved values; the named separate state per environment instead handles the requirement to prevent staging changes from unintentionally sharing the production state mapping, so this behavior does not describe Separate state per environment in the situation named.
F:The description applies to the state serial number when an engineer needs to understand how successive snapshots are ordered; the named separate state per environment instead handles the requirement to prevent staging changes from unintentionally sharing the production state mapping, so this behavior does not describe Separate state per environment in the situation named.
Question 690
A reusable module interface review needs to keep authentication and deployment-specific region choices outside a reusable child module. Which feature or operation is the most direct match?
- Avoiding hard-coded child credentials
- Module-level depends_on
- A module dependency interface
- Using a module registry version
- A module with for_each
- A module with count
Explanation
Correct Answer
A:Reusable modules normally declare provider requirements while callers supply provider configurations and credentials; this directly meets the requirement to keep authentication and deployment-specific region choices outside a reusable child module. By comparison, a module with count is intended to instantiate a fixed number of child module copies, which is a different task from keep authentication and deployment-specific region choices outside a reusable child module.
Incorrect Answers
B:depends_on on a module call affects all resources and data sources inside that module and can constrain concurrency; this mechanism is useful when the job is to create an explicit ordering edge for module resources that have a real hidden dependency, whereas the current scenario requires the engineer to keep authentication and deployment-specific region choices outside a reusable child module. These operations have different effects in the stated Terraform workflow.
C:An output-to-input reference establishes a natural dependency and avoids imposing broad depends_on edges unnecessarily; this mechanism is useful when the job is to connect two modules by declared output and input values, whereas the current scenario requires the engineer to keep authentication and deployment-specific region choices outside a reusable child module. These operations have different effects in the stated Terraform workflow.
D:The module block's version argument can constrain registry modules and is separate from Terraform CLI and provider version settings; this mechanism is useful when the job is to control which published module release a root configuration consumes, whereas the current scenario requires the engineer to keep authentication and deployment-specific region choices outside a reusable child module. These operations have different effects in the stated Terraform workflow.
E:The for_each meta-argument instantiates keyed module instances addressable as module.NAME["key"]; this mechanism is useful when the job is to create one child module instance for each stable application key, whereas the current scenario requires the engineer to keep authentication and deployment-specific region choices outside a reusable child module. These operations have different effects in the stated Terraform workflow.
F:The count meta-argument creates numerically indexed module instances such as module.worker[0]; this mechanism is useful when the job is to instantiate a fixed number of child module copies, whereas the current scenario requires the engineer to keep authentication and deployment-specific region choices outside a reusable child module. These operations have different effects in the stated Terraform workflow.