Question 610
A Terraform rollout has two separate requirements: first, convert a collection into a set before using for_each; second, represent unique elements where ordering does not matter. Which assignment of mechanisms correctly handles both responsibilities?
- First use Type conversion function; then use Set type.
- First use Object type; then use Set type.
- First use Map type; then use Object type.
- First use Type conversion function; then use Map type.
- First use Set type; then use Type conversion function.
Explanation
Correct Answer
A:The first requirement, to convert a collection into a set before using for_each, is handled by Type conversion function: toset(...) converts suitable values into a set, removing duplicates from a list input. The second requirement, to represent unique elements where ordering does not matter, is handled by Set type: A set(T) deduplicates members and does not guarantee a stable positional order. Each of these mechanisms has a distinct responsibility.
Incorrect Answers
B:For the requested tasks to convert a collection into a set before using for_each and represent unique elements where ordering does not matter, the first candidate Object type addresses define a fixed schema of named attributes with declared types; the second candidate Set type addresses represent unique elements where ordering does not matter. This mapping fails because the first mechanism primarily supports the task to define a fixed schema of named attributes with declared types; the actual requirements are convert a collection into a set before using for_each first and represent unique elements where ordering does not matter second.
C:For the requested tasks to convert a collection into a set before using for_each and represent unique elements where ordering does not matter, the first candidate Map type addresses associate string keys with values of one element type; the second candidate Object type addresses define a fixed schema of named attributes with declared types. This mapping fails because the first mechanism primarily supports the task to associate string keys with values of one element type and the second mechanism primarily supports the task to define a fixed schema of named attributes with declared types; the actual requirements are convert a collection into a set before using for_each first and represent unique elements where ordering does not matter second.
D:For the requested tasks to convert a collection into a set before using for_each and represent unique elements where ordering does not matter, the first candidate Type conversion function addresses convert a collection into a set before using for_each; the second candidate Map type addresses associate string keys with values of one element type. This mapping fails because the second mechanism primarily supports the task to associate string keys with values of one element type; the actual requirements are convert a collection into a set before using for_each first and represent unique elements where ordering does not matter second.
E:For the requested tasks to convert a collection into a set before using for_each and represent unique elements where ordering does not matter, the first candidate Set type addresses represent unique elements where ordering does not matter; the second candidate Type conversion function addresses convert a collection into a set before using for_each. This mapping fails because the first mechanism primarily supports the task to represent unique elements where ordering does not matter and the second mechanism primarily supports the task to convert a collection into a set before using for_each; the actual requirements are convert a collection into a set before using for_each first and represent unique elements where ordering does not matter second.
Question 611
The implementation must both reject a proposed change whose behavior is unsafe even when HCL is valid and avoid plugin-schema errors when checking a newly cloned configuration. Which TWO mechanisms directly address these two separate requirements? Choose TWO.
- Validate after initializing
- Validation of module inputs
- Formatting versus validation
- Validation versus plan authorization
- terraform validate command
Explanation
Correct Answers
A:Among the paired tasks to reject a proposed change whose behavior is unsafe even when HCL is valid and avoid plugin-schema errors when checking a newly cloned configuration, Validate after initializing serves the requirement to avoid plugin-schema errors when checking a newly cloned configuration: An initialized directory provides modules and provider schemas needed for full configuration validation. The other task must be covered by a separate mechanism.
D:Among the paired tasks to reject a proposed change whose behavior is unsafe even when HCL is valid and avoid plugin-schema errors when checking a newly cloned configuration, Validation versus plan authorization serves the requirement to reject a proposed change whose behavior is unsafe even when HCL is valid: Terraform validation verifies configuration well-formedness, not business policy or risk. The other task must be covered by a separate mechanism.
Incorrect Answers
B:The requirements are reject a proposed change whose behavior is unsafe even when HCL is valid and avoid plugin-schema errors when checking a newly cloned configuration, while Validation of module inputs supports the different task to catch an unsupported or missing required module argument early: terraform validate can report module call errors that violate input or schema requirements. That capability is outside the two selected responsibilities.
C:The requirements are reject a proposed change whose behavior is unsafe even when HCL is valid and avoid plugin-schema errors when checking a newly cloned configuration, while Formatting versus validation supports the different task to distinguish syntactically valid code from canonical HCL formatting: terraform fmt changes layout and spacing; terraform validate checks configuration correctness. That capability is outside the two selected responsibilities.
E:The requirements are reject a proposed change whose behavior is unsafe even when HCL is valid and avoid plugin-schema errors when checking a newly cloned configuration, while terraform validate command supports the different task to check configuration syntax and internal consistency without proposing resource changes: terraform validate checks the configuration's structural validity in an initialized directory. That capability is outside the two selected responsibilities.
Question 612
A Terraform rollout has two separate requirements: first, consume published output values from another Terraform state where supported; second, keep a team deployment's current state in a shared backend. Which assignment of mechanisms correctly handles both responsibilities?
- First use Backend credential management; then use Remote state centralization.
- First use Remote state centralization; then use Data source for remote state outputs.
- First use Data source for remote state outputs; then use Backend partial configuration.
- First use Data source for remote state outputs; then use Remote state centralization.
- First use Backend partial configuration; then use Backend credential management.
Explanation
Correct Answer
D:The first requirement, to consume published output values from another Terraform state where supported, is handled by Data source for remote state outputs: terraform_remote_state exposes root output values from a compatible existing state snapshot. The second requirement, to keep a team deployment's current state in a shared backend, is handled by Remote state centralization: Remote state gives authorized runners a common state location rather than separate laptop snapshots. Each of these mechanisms has a distinct responsibility.
Incorrect Answers
A:For the requested tasks to consume published output values from another Terraform state where supported and keep a team deployment's current state in a shared backend, the first candidate Backend credential management addresses authenticate backend access without embedding credentials in Terraform source; the second candidate Remote state centralization addresses keep a team deployment's current state in a shared backend. This mapping fails because the first mechanism primarily supports the task to authenticate backend access without embedding credentials in Terraform source; the actual requirements are consume published output values from another Terraform state where supported first and keep a team deployment's current state in a shared backend second.
B:For the requested tasks to consume published output values from another Terraform state where supported and keep a team deployment's current state in a shared backend, the first candidate Remote state centralization addresses keep a team deployment's current state in a shared backend; the second candidate Data source for remote state outputs addresses consume published output values from another Terraform state where supported. This mapping fails because the first mechanism primarily supports the task to keep a team deployment's current state in a shared backend and the second mechanism primarily supports the task to consume published output values from another Terraform state where supported; the actual requirements are consume published output values from another Terraform state where supported first and keep a team deployment's current state in a shared backend second.
C:For the requested tasks to consume published output values from another Terraform state where supported and keep a team deployment's current state in a shared backend, the first candidate Data source for remote state outputs addresses consume published output values from another Terraform state where supported; the second candidate Backend partial configuration addresses supply backend settings during init rather than hardcoding all values. This mapping fails because the second mechanism primarily supports the task to supply backend settings during init rather than hardcoding all values; the actual requirements are consume published output values from another Terraform state where supported first and keep a team deployment's current state in a shared backend second.
E:For the requested tasks to consume published output values from another Terraform state where supported and keep a team deployment's current state in a shared backend, the first candidate Backend partial configuration addresses supply backend settings during init rather than hardcoding all values; the second candidate Backend credential management addresses authenticate backend access without embedding credentials in Terraform source. This mapping fails because the first mechanism primarily supports the task to supply backend settings during init rather than hardcoding all values and the second mechanism primarily supports the task to authenticate backend access without embedding credentials in Terraform source; the actual requirements are consume published output values from another Terraform state where supported first and keep a team deployment's current state in a shared backend second.
Question 613
A Terraform rollout has two separate requirements: first, make infrastructure dependencies understandable from code; second, recreate equivalent infrastructure patterns from one codebase. Which assignment of mechanisms correctly handles both responsibilities?
- First use Self-documenting resource relationships; then use Peer review for infrastructure.
- First use Automated provisioning pipeline; then use Repeatable environment provisioning.
- First use Self-documenting resource relationships; then use Repeatable environment provisioning.
- First use Repeatable environment provisioning; then use Self-documenting resource relationships.
- First use Peer review for infrastructure; then use Automated provisioning pipeline.
Explanation
Correct Answer
C:The first requirement, to make infrastructure dependencies understandable from code, is handled by Self-documenting resource relationships: Resource references and explicit dependencies can express how objects relate without relying on tribal knowledge. The second requirement, to recreate equivalent infrastructure patterns from one codebase, is handled by Repeatable environment provisioning: Parameterizing reusable Terraform modules can provision consistent environment patterns repeatedly. Each of these mechanisms has a distinct responsibility.
Incorrect Answers
A:For the requested tasks to make infrastructure dependencies understandable from code and recreate equivalent infrastructure patterns from one codebase, the first candidate Self-documenting resource relationships addresses make infrastructure dependencies understandable from code; the second candidate Peer review for infrastructure addresses require approval before risky infrastructure changes. This mapping fails because the second mechanism primarily supports the task to require approval before risky infrastructure changes; the actual requirements are make infrastructure dependencies understandable from code first and recreate equivalent infrastructure patterns from one codebase second.
B:For the requested tasks to make infrastructure dependencies understandable from code and recreate equivalent infrastructure patterns from one codebase, the first candidate Automated provisioning pipeline addresses replace repetitive click-by-click resource deployment with a pipeline; the second candidate Repeatable environment provisioning addresses recreate equivalent infrastructure patterns from one codebase. This mapping fails because the first mechanism primarily supports the task to replace repetitive click-by-click resource deployment with a pipeline; the actual requirements are make infrastructure dependencies understandable from code first and recreate equivalent infrastructure patterns from one codebase second.
D:For the requested tasks to make infrastructure dependencies understandable from code and recreate equivalent infrastructure patterns from one codebase, the first candidate Repeatable environment provisioning addresses recreate equivalent infrastructure patterns from one codebase; the second candidate Self-documenting resource relationships addresses make infrastructure dependencies understandable from code. This mapping fails because the first mechanism primarily supports the task to recreate equivalent infrastructure patterns from one codebase and the second mechanism primarily supports the task to make infrastructure dependencies understandable from code; the actual requirements are make infrastructure dependencies understandable from code first and recreate equivalent infrastructure patterns from one codebase second.
E:For the requested tasks to make infrastructure dependencies understandable from code and recreate equivalent infrastructure patterns from one codebase, the first candidate Peer review for infrastructure addresses require approval before risky infrastructure changes; the second candidate Automated provisioning pipeline addresses replace repetitive click-by-click resource deployment with a pipeline. This mapping fails because the first mechanism primarily supports the task to require approval before risky infrastructure changes and the second mechanism primarily supports the task to replace repetitive click-by-click resource deployment with a pipeline; the actual requirements are make infrastructure dependencies understandable from code first and recreate equivalent infrastructure patterns from one codebase second.
Question 614
The implementation must both preserve resource identity when a configuration resource is moved into a module and deploy a common module separately for several named environments. Which TWO mechanisms directly address these two separate requirements? Choose TWO.
- Module output composition
- Module count meta-argument
- Module refactor with moved block
- Multiple instances of one module
- Module block invocation
Explanation
Correct Answers
C:Among the paired tasks to preserve resource identity when a configuration resource is moved into a module and deploy a common module separately for several named environments, Module refactor with moved block serves the requirement to preserve resource identity when a configuration resource is moved into a module: A moved block can map an old resource address to a new module resource address for state-aware refactoring. The other task must be covered by a separate mechanism.
D:Among the paired tasks to preserve resource identity when a configuration resource is moved into a module and deploy a common module separately for several named environments, Multiple instances of one module serves the requirement to deploy a common module separately for several named environments: for_each on a module block can create a keyed child module instance per entry. The other task must be covered by a separate mechanism.
Incorrect Answers
A:The requirements are preserve resource identity when a configuration resource is moved into a module and deploy a common module separately for several named environments, while Module output composition supports the different task to wire one module's published result into another module's input: References such as module.network.vpc_id can supply another module's required variable. That capability is outside the two selected responsibilities.
B:The requirements are preserve resource identity when a configuration resource is moved into a module and deploy a common module separately for several named environments, while Module count meta-argument supports the different task to optionally instantiate a module based on a count expression: count on a module block creates zero or more indexed module instances. That capability is outside the two selected responsibilities.
E:The requirements are preserve resource identity when a configuration resource is moved into a module and deploy a common module separately for several named environments, while Module block invocation supports the different task to compose a reusable infrastructure component into a root configuration: A module block points at a source and supplies declared input arguments to a child module. That capability is outside the two selected responsibilities.
Question 615
A Terraform rollout has two separate requirements: first, separate administrative grouping from reusable Terraform code; second, associate one infrastructure workspace with the correct organizational project. Which assignment of mechanisms correctly handles both responsibilities?
- First use Project organization versus module reuse; then use Workspace placement within a project.
- First use Project-level team access; then use Workspace placement within a project.
- First use Workspace placement within a project; then use Project organization versus module reuse.
- First use Project organization versus module reuse; then use Workspace variable isolation.
- First use Workspace variable isolation; then use Project-level team access.
Explanation
Correct Answer
A:The first requirement, to separate administrative grouping from reusable Terraform code, is handled by Project organization versus module reuse: Projects group workspaces for access and organization, while modules encapsulate configuration for reuse. The second requirement, to associate one infrastructure workspace with the correct organizational project, is handled by Workspace placement within a project: A workspace can be assigned to a project representing its team or platform boundary. Each of these mechanisms has a distinct responsibility.
Incorrect Answers
B:For the requested tasks to separate administrative grouping from reusable Terraform code and associate one infrastructure workspace with the correct organizational project, the first candidate Project-level team access addresses delegate a set of workspaces without granting broad organization-wide rights; the second candidate Workspace placement within a project addresses associate one infrastructure workspace with the correct organizational project. This mapping fails because the first mechanism primarily supports the task to delegate a set of workspaces without granting broad organization-wide rights; the actual requirements are separate administrative grouping from reusable Terraform code first and associate one infrastructure workspace with the correct organizational project second.
C:For the requested tasks to separate administrative grouping from reusable Terraform code and associate one infrastructure workspace with the correct organizational project, the first candidate Workspace placement within a project addresses associate one infrastructure workspace with the correct organizational project; the second candidate Project organization versus module reuse addresses separate administrative grouping from reusable Terraform code. This mapping fails because the first mechanism primarily supports the task to associate one infrastructure workspace with the correct organizational project and the second mechanism primarily supports the task to separate administrative grouping from reusable Terraform code; the actual requirements are separate administrative grouping from reusable Terraform code first and associate one infrastructure workspace with the correct organizational project second.
D:For the requested tasks to separate administrative grouping from reusable Terraform code and associate one infrastructure workspace with the correct organizational project, the first candidate Project organization versus module reuse addresses separate administrative grouping from reusable Terraform code; the second candidate Workspace variable isolation addresses give development and production separate credentials and deployment values. This mapping fails because the second mechanism primarily supports the task to give development and production separate credentials and deployment values; the actual requirements are separate administrative grouping from reusable Terraform code first and associate one infrastructure workspace with the correct organizational project second.
E:For the requested tasks to separate administrative grouping from reusable Terraform code and associate one infrastructure workspace with the correct organizational project, the first candidate Workspace variable isolation addresses give development and production separate credentials and deployment values; the second candidate Project-level team access addresses delegate a set of workspaces without granting broad organization-wide rights. This mapping fails because the first mechanism primarily supports the task to give development and production separate credentials and deployment values and the second mechanism primarily supports the task to delegate a set of workspaces without granting broad organization-wide rights; the actual requirements are separate administrative grouping from reusable Terraform code first and associate one infrastructure workspace with the correct organizational project second.
Question 616
A Terraform rollout has two separate requirements: first, locate a relevant module or resource without reading every tracked address; second, inspect stored attributes for one tracked resource instance. Which assignment of mechanisms correctly handles both responsibilities?
- First use terraform show -json; then use terraform state show ADDRESS.
- First use Address filter for state list; then use terraform state show ADDRESS.
- First use terraform state show ADDRESS; then use Address filter for state list.
- First use terraform show; then use terraform show -json.
- First use Address filter for state list; then use terraform show.
Explanation
Correct Answer
B:The first requirement, to locate a relevant module or resource without reading every tracked address, is handled by Address filter for state list: state list accepts optional address patterns to narrow visible resources. The second requirement, to inspect stored attributes for one tracked resource instance, is handled by terraform state show ADDRESS: state show presents the state representation of an addressed resource. Each of these mechanisms has a distinct responsibility.
Incorrect Answers
A:For the requested tasks to locate a relevant module or resource without reading every tracked address and inspect stored attributes for one tracked resource instance, the first candidate terraform show -json addresses export state or saved plan information in machine-readable form; the second candidate terraform state show ADDRESS addresses inspect stored attributes for one tracked resource instance. This mapping fails because the first mechanism primarily supports the task to export state or saved plan information in machine-readable form; the actual requirements are locate a relevant module or resource without reading every tracked address first and inspect stored attributes for one tracked resource instance second.
C:For the requested tasks to locate a relevant module or resource without reading every tracked address and inspect stored attributes for one tracked resource instance, the first candidate terraform state show ADDRESS addresses inspect stored attributes for one tracked resource instance; the second candidate Address filter for state list addresses locate a relevant module or resource without reading every tracked address. This mapping fails because the first mechanism primarily supports the task to inspect stored attributes for one tracked resource instance and the second mechanism primarily supports the task to locate a relevant module or resource without reading every tracked address; the actual requirements are locate a relevant module or resource without reading every tracked address first and inspect stored attributes for one tracked resource instance second.
D:For the requested tasks to locate a relevant module or resource without reading every tracked address and inspect stored attributes for one tracked resource instance, the first candidate terraform show addresses inspect the latest state or a saved execution plan in readable form; the second candidate terraform show -json addresses export state or saved plan information in machine-readable form. This mapping fails because the first mechanism primarily supports the task to inspect the latest state or a saved execution plan in readable form and the second mechanism primarily supports the task to export state or saved plan information in machine-readable form; the actual requirements are locate a relevant module or resource without reading every tracked address first and inspect stored attributes for one tracked resource instance second.
E:For the requested tasks to locate a relevant module or resource without reading every tracked address and inspect stored attributes for one tracked resource instance, the first candidate Address filter for state list addresses locate a relevant module or resource without reading every tracked address; the second candidate terraform show addresses inspect the latest state or a saved execution plan in readable form. This mapping fails because the second mechanism primarily supports the task to inspect the latest state or a saved execution plan in readable form; the actual requirements are locate a relevant module or resource without reading every tracked address first and inspect stored attributes for one tracked resource instance second.
Question 617
A configuration review identifies the need to transform a collection into a list of calculated values. Which mechanism most directly meets this particular need?
- for expression list projection
- for_each resource replication
- Built-in collection function
- Dynamic nested block
Explanation
Correct Answer
A:The task is to transform a collection into a list of calculated values; for expression list projection directly supports that requirement: A bracketed for expression maps each element to a new value using a declared iterator. Its relevant boundary is: A for expression calculates values but does not itself create resource instances.
Incorrect Answers
B:for_each resource replication is designed to create one resource instance per unique map or set key, whereas this task is to transform a collection into a list of calculated values: for_each expands a resource into stable keyed instances when its collection is known at planning. Against for expression list projection, its limitation is: Keys cannot be unknown or derived directly from sensitive values.
C:Built-in collection function is designed to calculate collection values without an external provisioner, whereas this task is to transform a collection into a list of calculated values: Functions such as length, concat, and merge manipulate Terraform values during expression evaluation. Against for expression list projection, its limitation is: A function call does not fetch remote provider resources unless a data source is used.
D:Dynamic nested block is designed to generate repeated nested configuration blocks from a collection, whereas this task is to transform a collection into a list of calculated values: A dynamic block emits nested blocks where the enclosing resource schema permits them. Against for expression list projection, its limitation is: Dynamic cannot generate resource or provider blocks at the root level.
Question 618
The deployment owner requests a reliable way to preview actions required to reach the declared infrastructure state. Which mechanism most directly meets this particular need?
- Plan without state refresh
- Replacement plan indicator
- Machine-readable plan inspection
- terraform plan command
Explanation
Correct Answer
D:The task is to preview actions required to reach the declared infrastructure state; terraform plan command directly supports that requirement: terraform plan shows changes Terraform expects, including creates, updates, deletes, and replacements. Its relevant boundary is: Plan does not persist the proposed changes to remote infrastructure.
Incorrect Answers
A:Plan without state refresh is designed to avoid remote refresh reads when an intentional troubleshooting constraint requires it, whereas this task is to preview actions required to reach the declared infrastructure state: terraform plan -refresh=false uses existing state without refreshing live objects before planning. Against terraform plan command, its limitation is: A plan based on stale state can be inaccurate about real infrastructure.
B:Replacement plan indicator is designed to recognize that a proposed change will replace an existing resource, whereas this task is to preview actions required to reach the declared infrastructure state: The plan symbols -/+ or +/- indicate replacement behavior and its creation/destruction ordering. Against terraform plan command, its limitation is: An in-place update is represented differently and preserves the existing instance.
C:Machine-readable plan inspection is designed to convert a saved plan into JSON for automated analysis, whereas this task is to preview actions required to reach the declared infrastructure state: terraform show -json change.tfplan exposes plan details for tooling. Against terraform plan command, its limitation is: The JSON can expose secrets and requires secure handling.
Question 619
A platform engineering group needs to configure a second instance of the same provider for another account or region. Which mechanism most directly meets this particular need?
- Different provider local names
- Aliased provider instance
- Resource provider meta-argument
- Explicit child module provider mapping
Explanation
Correct Answer
B:The task is to configure a second instance of the same provider for another account or region; Aliased provider instance directly supports that requirement: The alias argument gives a provider configuration an additional address that resources can select. Its relevant boundary is: The existence of an alias does not move existing resources to that configuration automatically.
Incorrect Answers
A:Different provider local names is designed to declare several provider types in the same root module, whereas this task is to configure a second instance of the same provider for another account or region: The required_providers map can list multiple source addresses with distinct local names. Against Aliased provider instance, its limitation is: Resources still use their provider-defined schemas and credentials.
C:Resource provider meta-argument is designed to direct an individual resource to the intended aliased provider, whereas this task is to configure a second instance of the same provider for another account or region: The provider meta-argument can select a configured instance such as aws.west for that resource. Against Aliased provider instance, its limitation is: The alias must be declared and satisfy provider requirements.
D:Explicit child module provider mapping is designed to pass an aliased provider to resources inside a child module, whereas this task is to configure a second instance of the same provider for another account or region: The providers map in a module block maps the child's provider name to a parent provider configuration. Against Aliased provider instance, its limitation is: A child module cannot automatically see every parent alias just because it exists.
Question 620
A platform engineering group needs to recognize that a resource was changed outside Terraform. Which mechanism most directly meets this particular need?
- Refresh-only reconciliation
- Remote drift detection during plan
- removed block with destroy=false
- moved block for refactoring
Explanation
Correct Answer
B:The task is to recognize that a resource was changed outside Terraform; Remote drift detection during plan directly supports that requirement: Normal plan refresh reads can reveal drift between state and the remote object. Its relevant boundary is: Configuration reconciliation requires a subsequent reviewed apply.
Incorrect Answers
A:Refresh-only reconciliation is designed to accept an external change into Terraform state without modifying remote infrastructure, whereas this task is to recognize that a resource was changed outside Terraform: A refresh-only plan or apply updates state and outputs to observed values. Against Remote drift detection during plan, 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 recognize that a resource was changed outside Terraform: A removed block declares that Terraform should forget a resource without deleting it when destroy=false. Against Remote drift detection during plan, its limitation is: Ordinary resource removal from HCL can instead lead to destruction.
D:moved block for refactoring is designed to rename a managed resource address without destroying its remote object, whereas this task is to recognize that a resource was changed outside Terraform: A moved block describes an address migration as part of configuration history. Against Remote drift detection during plan, its limitation is: It does not transfer a resource between unrelated provider types.