Question 670
A Terraform rollout has two separate requirements: first, capture one execution plan for later approval and application; second, inspect externally changed infrastructure without planning configuration reconciliation. Which assignment of mechanisms correctly handles both responsibilities?
- First use Plan without state refresh; then use Machine-readable plan inspection.
- First use Plan saved to file; then use Refresh-only planning.
- First use Refresh-only planning; then use Plan saved to file.
- First use Machine-readable plan inspection; then use Refresh-only planning.
- First use Plan saved to file; then use Plan without state refresh.
Explanation
Correct Answer
B:The first requirement, to capture one execution plan for later approval and application, is handled by Plan saved to file: terraform plan -out=change.tfplan saves an executable binary plan artifact. The second requirement, to inspect externally changed infrastructure without planning configuration reconciliation, is handled by Refresh-only planning: terraform plan -refresh-only proposes updates to state and outputs based on remote observations. Each of these mechanisms has a distinct responsibility.
Incorrect Answers
A:For the requested tasks to capture one execution plan for later approval and application and inspect externally changed infrastructure without planning configuration reconciliation, the first candidate Plan without state refresh addresses avoid remote refresh reads when an intentional troubleshooting constraint requires it; the second candidate Machine-readable plan inspection addresses convert a saved plan into JSON for automated analysis. This mapping fails because the first mechanism primarily supports the task to avoid remote refresh reads when an intentional troubleshooting constraint requires it and the second mechanism primarily supports the task to convert a saved plan into JSON for automated analysis; the actual requirements are capture one execution plan for later approval and application first and inspect externally changed infrastructure without planning configuration reconciliation second.
C:For the requested tasks to capture one execution plan for later approval and application and inspect externally changed infrastructure without planning configuration reconciliation, the first candidate Refresh-only planning addresses inspect externally changed infrastructure without planning configuration reconciliation; the second candidate Plan saved to file addresses capture one execution plan for later approval and application. This mapping fails because the first mechanism primarily supports the task to inspect externally changed infrastructure without planning configuration reconciliation and the second mechanism primarily supports the task to capture one execution plan for later approval and application; the actual requirements are capture one execution plan for later approval and application first and inspect externally changed infrastructure without planning configuration reconciliation second.
D:For the requested tasks to capture one execution plan for later approval and application and inspect externally changed infrastructure without planning configuration reconciliation, the first candidate Machine-readable plan inspection addresses convert a saved plan into JSON for automated analysis; the second candidate Refresh-only planning addresses inspect externally changed infrastructure without planning configuration reconciliation. This mapping fails because the first mechanism primarily supports the task to convert a saved plan into JSON for automated analysis; the actual requirements are capture one execution plan for later approval and application first and inspect externally changed infrastructure without planning configuration reconciliation second.
E:For the requested tasks to capture one execution plan for later approval and application and inspect externally changed infrastructure without planning configuration reconciliation, the first candidate Plan saved to file addresses capture one execution plan for later approval and application; the second candidate Plan without state refresh addresses avoid remote refresh reads when an intentional troubleshooting constraint requires it. This mapping fails because the second mechanism primarily supports the task to avoid remote refresh reads when an intentional troubleshooting constraint requires it; the actual requirements are capture one execution plan for later approval and application first and inspect externally changed infrastructure without planning configuration reconciliation second.
Question 671
The implementation must both accept an external change into Terraform state without modifying remote infrastructure and stop tracking an object in state but deliberately leave it deployed. Which TWO mechanisms directly address these two separate requirements? Choose TWO.
- terraform state rm
- Refresh-only reconciliation
- moved block for refactoring
- removed block with destroy=false
- Remote drift detection during plan
Explanation
Correct Answers
B:Among the paired tasks to accept an external change into Terraform state without modifying remote infrastructure and stop tracking an object in state but deliberately leave it deployed, Refresh-only reconciliation serves the requirement to accept an external change into Terraform state without modifying remote infrastructure: A refresh-only plan or apply updates state and outputs to observed values. The other task must be covered by a separate mechanism.
D:Among the paired tasks to accept an external change into Terraform state without modifying remote infrastructure and stop tracking an object in state but deliberately leave it deployed, removed block with destroy=false serves the requirement to stop tracking an object in state but deliberately leave it deployed: A removed block declares that Terraform should forget a resource without deleting it when destroy=false. The other task must be covered by a separate mechanism.
Incorrect Answers
A:The requirements are accept an external change into Terraform state without modifying remote infrastructure and stop tracking an object in state but deliberately leave it deployed, while terraform state rm supports the different task to detach a resource address from state while leaving the remote object intact: state rm forgets the binding but does not delete the real infrastructure object. That capability is outside the two selected responsibilities.
C:The requirements are accept an external change into Terraform state without modifying remote infrastructure and stop tracking an object in state but deliberately leave it deployed, while moved block for refactoring supports the different task to rename a managed resource address without destroying its remote object: A moved block describes an address migration as part of configuration history. That capability is outside the two selected responsibilities.
E:The requirements are accept an external change into Terraform state without modifying remote infrastructure and stop tracking an object in state but deliberately leave it deployed, while Remote drift detection during plan supports the different task to recognize that a resource was changed outside Terraform: Normal plan refresh reads can reveal drift between state and the remote object. That capability is outside the two selected responsibilities.
Question 672
The rollout owner asks whether Conditional expression is sufficient to choose between two values based on a boolean condition. Which limitation specifically concerns that mechanism?
- Dynamic cannot generate resource or provider blocks at the root level.
- A for expression calculates values but does not itself create resource instances.
- A function call does not fetch remote provider resources unless a data source is used.
- Keys cannot be unknown or derived directly from sensitive values.
- The two branches need compatible types for Terraform to reconcile the result.
Explanation
Correct Answer
E:For Conditional expression in the task to choose between two values based on a boolean condition, the important caution is: The two branches need compatible types for Terraform to reconcile the result. The reason this matters is its actual behavior: Terraform's condition ? true_value : false_value expression selects a value based on a predicate.
Incorrect Answers
A:The proposed warning belongs to Dynamic nested block, which serves the different goal to generate repeated nested configuration blocks from a collection, rather than to Conditional expression: A dynamic block emits nested blocks where the enclosing resource schema permits them. The question concerns Conditional expression acting to choose between two values based on a boolean condition, not a limit of Dynamic nested block.
B:The proposed warning belongs to for expression list projection, which serves the different goal to transform a collection into a list of calculated values, rather than to Conditional expression: A bracketed for expression maps each element to a new value using a declared iterator. The question concerns Conditional expression acting to choose between two values based on a boolean condition, not a limit of for expression list projection.
C:The proposed warning belongs to Built-in collection function, which serves the different goal to calculate collection values without an external provisioner, rather than to Conditional expression: Functions such as length, concat, and merge manipulate Terraform values during expression evaluation. The question concerns Conditional expression acting to choose between two values based on a boolean condition, not a limit of Built-in collection function.
D:The proposed warning belongs to for_each resource replication, which serves the different goal to create one resource instance per unique map or set key, rather than to Conditional expression: for_each expands a resource into stable keyed instances when its collection is known at planning. The question concerns Conditional expression acting to choose between two values based on a boolean condition, not a limit of for_each resource replication.
Question 673
A Terraform rollout has two separate requirements: first, make a published module dependency deterministic across clean installs; second, pin a VCS module using its source ref rather than registry version. Which assignment of mechanisms correctly handles both responsibilities?
- First use Version of Git module; then use Exact registry module version.
- First use Local module development lifecycle; then use Module release compatibility.
- First use Exact registry module version; then use Local module development lifecycle.
- First use Exact registry module version; then use Version of Git module.
- First use Module release compatibility; then use Version of Git module.
Explanation
Correct Answer
D:The first requirement, to make a published module dependency deterministic across clean installs, is handled by Exact registry module version: An exact version requirement identifies one registry module release. The second requirement, to pin a VCS module using its source ref rather than registry version, is handled by Version of Git module: A ?ref=tag or commit in a Git module source selects the VCS revision to fetch. Each of these mechanisms has a distinct responsibility.
Incorrect Answers
A:For the requested tasks to make a published module dependency deterministic across clean installs and pin a VCS module using its source ref rather than registry version, the first candidate Version of Git module addresses pin a VCS module using its source ref rather than registry version; the second candidate Exact registry module version addresses make a published module dependency deterministic across clean installs. This mapping fails because the first mechanism primarily supports the task to pin a VCS module using its source ref rather than registry version and the second mechanism primarily supports the task to make a published module dependency deterministic across clean installs; the actual requirements are make a published module dependency deterministic across clean installs first and pin a VCS module using its source ref rather than registry version second.
B:For the requested tasks to make a published module dependency deterministic across clean installs and pin a VCS module using its source ref rather than registry version, the first candidate Local module development lifecycle addresses update a local path module without applying registry release versioning; the second candidate Module release compatibility addresses constrain a module to releases with an expected interface. This mapping fails because the first mechanism primarily supports the task to update a local path module without applying registry release versioning and the second mechanism primarily supports the task to constrain a module to releases with an expected interface; the actual requirements are make a published module dependency deterministic across clean installs first and pin a VCS module using its source ref rather than registry version second.
C:For the requested tasks to make a published module dependency deterministic across clean installs and pin a VCS module using its source ref rather than registry version, the first candidate Exact registry module version addresses make a published module dependency deterministic across clean installs; the second candidate Local module development lifecycle addresses update a local path module without applying registry release versioning. This mapping fails because the second mechanism primarily supports the task to update a local path module without applying registry release versioning; the actual requirements are make a published module dependency deterministic across clean installs first and pin a VCS module using its source ref rather than registry version second.
E:For the requested tasks to make a published module dependency deterministic across clean installs and pin a VCS module using its source ref rather than registry version, the first candidate Module release compatibility addresses constrain a module to releases with an expected interface; the second candidate Version of Git module addresses pin a VCS module using its source ref rather than registry version. This mapping fails because the first mechanism primarily supports the task to constrain a module to releases with an expected interface; the actual requirements are make a published module dependency deterministic across clean installs first and pin a VCS module using its source ref rather than registry version second.
Question 674
A Terraform rollout has two separate requirements: first, associate a Terraform root configuration with an HCP Terraform organization and workspace; second, move a locally managed state history into an HCP Terraform workspace. Which assignment of mechanisms correctly handles both responsibilities?
- First use HCP Terraform workspace version settings; then use Local to HCP state migration.
- First use cloud block HCP integration; then use Local to HCP state migration.
- First use cloud block HCP integration; then use CLI-driven HCP runs.
- First use Local to HCP state migration; then use cloud block HCP integration.
- First use CLI-driven HCP runs; then use HCP Terraform workspace version settings.
Explanation
Correct Answer
B:The first requirement, to associate a Terraform root configuration with an HCP Terraform organization and workspace, is handled by cloud block HCP integration: A cloud block in terraform settings configures the HCP Terraform integration for that root module. The second requirement, to move a locally managed state history into an HCP Terraform workspace, is handled by Local to HCP state migration: Changing state integration and reinitializing can migrate state into HCP Terraform when configured correctly. Each of these mechanisms has a distinct responsibility.
Incorrect Answers
A:For the requested tasks to associate a Terraform root configuration with an HCP Terraform organization and workspace and move a locally managed state history into an HCP Terraform workspace, the first candidate HCP Terraform workspace version settings addresses control the Terraform version used for remote runs; the second candidate Local to HCP state migration addresses move a locally managed state history into an HCP Terraform workspace. This mapping fails because the first mechanism primarily supports the task to control the Terraform version used for remote runs; the actual requirements are associate a Terraform root configuration with an HCP Terraform organization and workspace first and move a locally managed state history into an HCP Terraform workspace second.
C:For the requested tasks to associate a Terraform root configuration with an HCP Terraform organization and workspace and move a locally managed state history into an HCP Terraform workspace, the first candidate cloud block HCP integration addresses associate a Terraform root configuration with an HCP Terraform organization and workspace; the second candidate CLI-driven HCP runs addresses initiate workspace operations through familiar Terraform commands. This mapping fails because the second mechanism primarily supports the task to initiate workspace operations through familiar Terraform commands; the actual requirements are associate a Terraform root configuration with an HCP Terraform organization and workspace first and move a locally managed state history into an HCP Terraform workspace second.
D:For the requested tasks to associate a Terraform root configuration with an HCP Terraform organization and workspace and move a locally managed state history into an HCP Terraform workspace, the first candidate Local to HCP state migration addresses move a locally managed state history into an HCP Terraform workspace; the second candidate cloud block HCP integration addresses associate a Terraform root configuration with an HCP Terraform organization and workspace. This mapping fails because the first mechanism primarily supports the task to move a locally managed state history into an HCP Terraform workspace and the second mechanism primarily supports the task to associate a Terraform root configuration with an HCP Terraform organization and workspace; the actual requirements are associate a Terraform root configuration with an HCP Terraform organization and workspace first and move a locally managed state history into an HCP Terraform workspace second.
E:For the requested tasks to associate a Terraform root configuration with an HCP Terraform organization and workspace and move a locally managed state history into an HCP Terraform workspace, the first candidate CLI-driven HCP runs addresses initiate workspace operations through familiar Terraform commands; the second candidate HCP Terraform workspace version settings addresses control the Terraform version used for remote runs. This mapping fails because the first mechanism primarily supports the task to initiate workspace operations through familiar Terraform commands and the second mechanism primarily supports the task to control the Terraform version used for remote runs; the actual requirements are associate a Terraform root configuration with an HCP Terraform organization and workspace first and move a locally managed state history into an HCP Terraform workspace second.
Question 675
A team reviews the use of Resource provider meta-argument in Terraform 1.12. Which purpose matches its actual behavior?
- direct an individual resource to the intended aliased provider
- create similar resources in different regions without duplicating the root module
- refer to a provider configuration by its local name and alias
- let a child module use default provider settings from its parent
Explanation
Correct Answer
A:The practical result of Resource provider meta-argument, used to direct an individual resource to the intended aliased provider, is: The provider meta-argument can select a configured instance such as aws.west for that resource. A qualification for this effect is: The alias must be declared and satisfy provider requirements.
Incorrect Answers
B:That outcome applies to Multiple regions in one configuration, intended to create similar resources in different regions without duplicating the root module, rather than the question's feature Resource provider meta-argument: Two provider instances with different region settings can serve explicitly assigned resources or modules. Unlike Multiple regions in one configuration, Resource provider meta-argument is intended to direct an individual resource to the intended aliased provider, not to create similar resources in different regions without duplicating the root module.
C:That outcome applies to Provider alias reference address, intended to refer to a provider configuration by its local name and alias, rather than the question's feature Resource provider meta-argument: An address such as aws.audit identifies a specific configured instance of the aws provider. Unlike Provider alias reference address, Resource provider meta-argument is intended to direct an individual resource to the intended aliased provider, not to refer to a provider configuration by its local name and alias.
D:That outcome applies to Default provider configuration inheritance, intended to let a child module use default provider settings from its parent, rather than the question's feature Resource provider meta-argument: Child modules commonly inherit default provider configurations from the calling module. Unlike Default provider configuration inheritance, Resource provider meta-argument is intended to direct an individual resource to the intended aliased provider, not to let a child module use default provider settings from its parent.
Question 676
A Terraform rollout has two separate requirements: first, choose between two values based on a boolean condition; second, calculate collection values without an external provisioner. Which assignment of mechanisms correctly handles both responsibilities?
- First use Conditional expression; then use Dynamic nested block.
- First use Conditional expression; then use Built-in collection function.
- First use Dynamic nested block; then use for_each resource replication.
- First use Built-in collection function; then use Conditional expression.
- First use for_each resource replication; then use Built-in collection function.
Explanation
Correct Answer
B:The first requirement, to choose between two values based on a boolean condition, is handled by Conditional expression: Terraform's condition ? true_value : false_value expression selects a value based on a predicate. The second requirement, to calculate collection values without an external provisioner, is handled by Built-in collection function: Functions such as length, concat, and merge manipulate Terraform values during expression evaluation. Each of these mechanisms has a distinct responsibility.
Incorrect Answers
A:For the requested tasks to choose between two values based on a boolean condition and calculate collection values without an external provisioner, the first candidate Conditional expression addresses choose between two values based on a boolean condition; the second candidate Dynamic nested block addresses generate repeated nested configuration blocks from a collection. This mapping fails because the second mechanism primarily supports the task to generate repeated nested configuration blocks from a collection; the actual requirements are choose between two values based on a boolean condition first and calculate collection values without an external provisioner second.
C:For the requested tasks to choose between two values based on a boolean condition and calculate collection values without an external provisioner, the first candidate Dynamic nested block addresses generate repeated nested configuration blocks from a collection; the second candidate for_each resource replication addresses create one resource instance per unique map or set key. This mapping fails because the first mechanism primarily supports the task to generate repeated nested configuration blocks from a collection and the second mechanism primarily supports the task to create one resource instance per unique map or set key; the actual requirements are choose between two values based on a boolean condition first and calculate collection values without an external provisioner second.
D:For the requested tasks to choose between two values based on a boolean condition and calculate collection values without an external provisioner, the first candidate Built-in collection function addresses calculate collection values without an external provisioner; the second candidate Conditional expression addresses choose between two values based on a boolean condition. This mapping fails because the first mechanism primarily supports the task to calculate collection values without an external provisioner and the second mechanism primarily supports the task to choose between two values based on a boolean condition; the actual requirements are choose between two values based on a boolean condition first and calculate collection values without an external provisioner second.
E:For the requested tasks to choose between two values based on a boolean condition and calculate collection values without an external provisioner, the first candidate for_each resource replication addresses create one resource instance per unique map or set key; the second candidate Built-in collection function addresses calculate collection values without an external provisioner. This mapping fails because the first mechanism primarily supports the task to create one resource instance per unique map or set key; the actual requirements are choose between two values based on a boolean condition first and calculate collection values without an external provisioner second.
Question 677
During a Terraform 1.12 implementation, the immediate requirement is to focus on a small subset for exceptional repair or troubleshooting. Which mechanism most directly meets this particular need?
- Replacement plan indicator
- Targeted planning
- Plan without state refresh
- Machine-readable plan inspection
- terraform plan command
Explanation
Correct Answer
B:The task is to focus on a small subset for exceptional repair or troubleshooting; Targeted planning directly supports that requirement: terraform plan -target=ADDRESS limits the planner's focus to the selected graph portion. Its relevant boundary is: Routine targeted planning can overlook intended changes elsewhere.
Incorrect Answers
A:Replacement plan indicator is designed to recognize that a proposed change will replace an existing resource, whereas this task is to focus on a small subset for exceptional repair or troubleshooting: The plan symbols -/+ or +/- indicate replacement behavior and its creation/destruction ordering. Against Targeted planning, its limitation is: An in-place update is represented differently and preserves the existing instance.
C:Plan without state refresh is designed to avoid remote refresh reads when an intentional troubleshooting constraint requires it, whereas this task is to focus on a small subset for exceptional repair or troubleshooting: terraform plan -refresh=false uses existing state without refreshing live objects before planning. Against Targeted planning, its limitation is: A plan based on stale state can be inaccurate about real infrastructure.
D:Machine-readable plan inspection is designed to convert a saved plan into JSON for automated analysis, whereas this task is to focus on a small subset for exceptional repair or troubleshooting: terraform show -json change.tfplan exposes plan details for tooling. Against Targeted planning, its limitation is: The JSON can expose secrets and requires secure handling.
E:terraform plan command is designed to preview actions required to reach the declared infrastructure state, whereas this task is to focus on a small subset for exceptional repair or troubleshooting: terraform plan shows changes Terraform expects, including creates, updates, deletes, and replacements. Against Targeted planning, its limitation is: Plan does not persist the proposed changes to remote infrastructure.
Question 678
A reviewer is asked to choose a mechanism to rename a managed resource address without destroying its remote object. Which mechanism most directly meets this particular need?
- moved block for refactoring
- Refresh-only reconciliation
- removed block with destroy=false
- terraform state rm
- terraform state mv
Explanation
Correct Answer
A:The task is to rename a managed resource address without destroying its remote object; moved block for refactoring directly supports that requirement: A moved block describes an address migration as part of configuration history. Its relevant boundary is: It does not transfer a resource between unrelated provider types.
Incorrect Answers
B:Refresh-only reconciliation is designed to accept an external change into Terraform state without modifying remote infrastructure, whereas this task is to rename a managed resource address without destroying its remote object: A refresh-only plan or apply updates state and outputs to observed values. Against moved block for refactoring, its limitation is: It does not make the live object conform to an old configuration value.
C:removed block with destroy=false is designed to stop tracking an object in state but deliberately leave it deployed, whereas this task is to rename a managed resource address without destroying its remote object: A removed block declares that Terraform should forget a resource without deleting it when destroy=false. Against moved block for refactoring, its limitation is: Ordinary resource removal from HCL can instead lead to destruction.
D:terraform state rm is designed to detach a resource address from state while leaving the remote object intact, whereas this task is to rename a managed resource address without destroying its remote object: state rm forgets the binding but does not delete the real infrastructure object. Against moved block for refactoring, its limitation is: If its configuration remains, a later plan can propose creating another object.
E:terraform state mv addresses the different requirement to change a resource state address to match a configuration refactor: state mv rebinds an existing object under a new compatible address; this does not by itself satisfy the requested task to rename a managed resource address without destroying its remote object. For the stated need, moved block for refactoring is the more direct mechanism.
Question 679
During an implementation review, a Terraform team encounters "Hybrid infrastructure automation". Which purpose is associated with that mechanism?
- configure cloud and on-premises platforms through a common workflow
- control DNS, SaaS, and cloud resources through a common configuration tool
- use a common language without pretending providers expose identical capabilities
- manage different clouds from one Terraform root module
Explanation
Correct Answer
A:The practical result of Hybrid infrastructure automation, used to configure cloud and on-premises platforms through a common workflow, is: Terraform can coordinate providers for hosted services and private infrastructure without imposing one cloud API. A qualification for this effect is: An appropriate provider or integration must exist for each target system.
Incorrect Answers
B:That outcome applies to Service-agnostic orchestration, intended to control DNS, SaaS, and cloud resources through a common configuration tool, rather than the question's feature Hybrid infrastructure automation: Terraform providers expose resource and data types beyond infrastructure hosted by a cloud vendor. Unlike Service-agnostic orchestration, Hybrid infrastructure automation is intended to configure cloud and on-premises platforms through a common workflow, not to control DNS, SaaS, and cloud resources through a common configuration tool.
C:That outcome applies to Provider-specific implementation, intended to use a common language without pretending providers expose identical capabilities, rather than the question's feature Hybrid infrastructure automation: HCL and workflow are common while each provider defines its own resource schema and service-specific behavior. Unlike Provider-specific implementation, Hybrid infrastructure automation is intended to configure cloud and on-premises platforms through a common workflow, not to use a common language without pretending providers expose identical capabilities.
D:That outcome applies to Multi-cloud provider configuration, intended to manage different clouds from one Terraform root module, rather than the question's feature Hybrid infrastructure automation: Separate provider plugins can reconcile resources on multiple platforms within the same configuration. Unlike Multi-cloud provider configuration, Hybrid infrastructure automation is intended to configure cloud and on-premises platforms through a common workflow, not to manage different clouds from one Terraform root module.
Question 680
A Terraform operator is specifically tasked to fetch a newly allowed version after editing the module version requirement. Which mechanism most directly meets this particular need?
- Registry module version constraint
- Version of Git module
- Local module development lifecycle
- Module upgrade through init
Explanation
Correct Answer
D:The task is to fetch a newly allowed version after editing the module version requirement; Module upgrade through init directly supports that requirement: Rerunning terraform init downloads compatible module source versions when module requirements change. Its relevant boundary is: terraform apply does not automatically fetch newly declared module packages.
Incorrect Answers
A:Registry module version constraint is designed to select module releases meeting a declared compatibility range, whereas this task is to fetch a newly allowed version after editing the module version requirement: A registry module call accepts a version argument that chooses supported release versions. Against Module upgrade through init, its limitation is: An unpinned module version may drift as newer releases appear.
B:Version of Git module is designed to pin a VCS module using its source ref rather than registry version, whereas this task is to fetch a newly allowed version after editing the module version requirement: A ?ref=tag or commit in a Git module source selects the VCS revision to fetch. Against Module upgrade through init, its limitation is: The registry module version argument does not apply to generic Git sources.
C:Local module development lifecycle addresses the different requirement to update a local path module without applying registry release versioning: Local module source code is read from its path and does not use a version argument; this does not by itself satisfy the requested task to fetch a newly allowed version after editing the module version requirement. For the stated need, Module upgrade through init is the more direct mechanism.