Question 580
A reviewer is asked to choose a mechanism to make infrastructure dependencies understandable from code. Which mechanism most directly meets this particular need?
- Peer review for infrastructure
- Version-controlled configuration history
- Self-documenting resource relationships
- Repeatable environment provisioning
Explanation
Correct Answer
C:The task is to make infrastructure dependencies understandable from code; Self-documenting resource relationships directly supports that requirement: Resource references and explicit dependencies can express how objects relate without relying on tribal knowledge. Its relevant boundary is: Provider behavior and implicit side effects still need relevant documentation.
Incorrect Answers
A:Peer review for infrastructure is designed to require approval before risky infrastructure changes, whereas this task is to make infrastructure dependencies understandable from code: Text configuration can be reviewed through a normal code review before an approved apply. Against Self-documenting resource relationships, its limitation is: Source approval does not replace inspecting the execution plan.
B:Version-controlled configuration history is designed to trace why infrastructure definitions changed, whereas this task is to make infrastructure dependencies understandable from code: Git commits and pull requests make configuration edits auditable before the next Terraform run. Against Self-documenting resource relationships, its limitation is: A Git diff tracks source files rather than proving the exact live infrastructure state.
D:Repeatable environment provisioning is designed to recreate equivalent infrastructure patterns from one codebase, whereas this task is to make infrastructure dependencies understandable from code: Parameterizing reusable Terraform modules can provision consistent environment patterns repeatedly. Against Self-documenting resource relationships, its limitation is: Differences in inputs and provider versions can still alter actual results.
Question 581
Before continuing an infrastructure rollout, the operator must locate a relevant module or resource without reading every tracked address. Which mechanism most directly meets this particular need?
- terraform show
- terraform state list
- terraform state show ADDRESS
- Address filter for state list
Explanation
Correct Answer
D:The task is to locate a relevant module or resource without reading every tracked address; Address filter for state list directly supports that requirement: state list accepts optional address patterns to narrow visible resources. Its relevant boundary is: An address filter does not delete unwanted resource records.
Incorrect Answers
A:terraform show is designed to inspect the latest state or a saved execution plan in readable form, whereas this task is to locate a relevant module or resource without reading every tracked address: terraform show can display an existing state snapshot or a named plan file. Against Address filter for state list, its limitation is: It is not the same as running a fresh plan against current infrastructure.
B:terraform state list is designed to enumerate Terraform resource addresses currently tracked in a state snapshot, whereas this task is to locate a relevant module or resource without reading every tracked address: state list displays managed addresses and can be narrowed with address filters. Against Address filter for state list, its limitation is: It does not enumerate every object in the cloud account.
C:terraform state show ADDRESS is designed to inspect stored attributes for one tracked resource instance, whereas this task is to locate a relevant module or resource without reading every tracked address: state show presents the state representation of an addressed resource. Against Address filter for state list, its limitation is: It does not perform an infrastructure change or show another resource automatically.
Question 582
A Terraform rollout has two separate requirements: first, emit machine-readable diagnostics for CI processing; second, check configuration syntax and internal consistency without proposing resource changes. Which assignment of mechanisms correctly handles both responsibilities?
- First use terraform validate -json; then use Validate after initializing.
- First use terraform validate -json; then use terraform validate command.
- First use terraform validate command; then use terraform validate -json.
- First use Validate after initializing; then use Validation of module inputs.
- First use Validation of module inputs; then use terraform validate command.
Explanation
Correct Answer
B:The first requirement, to emit machine-readable diagnostics for CI processing, is handled by terraform validate -json: The -json option provides structured validation results for scripts and automation. The second requirement, to check configuration syntax and internal consistency without proposing resource changes, is handled by terraform validate command: terraform validate checks the configuration's structural validity in an initialized directory. Each of these mechanisms has a distinct responsibility.
Incorrect Answers
A:For the requested tasks to emit machine-readable diagnostics for CI processing and check configuration syntax and internal consistency without proposing resource changes, the first candidate terraform validate -json addresses emit machine-readable diagnostics for CI processing; the second candidate Validate after initializing addresses avoid plugin-schema errors when checking a newly cloned configuration. This mapping fails because the second mechanism primarily supports the task to avoid plugin-schema errors when checking a newly cloned configuration; the actual requirements are emit machine-readable diagnostics for CI processing first and check configuration syntax and internal consistency without proposing resource changes second.
C:For the requested tasks to emit machine-readable diagnostics for CI processing and check configuration syntax and internal consistency without proposing resource changes, the first candidate terraform validate command addresses check configuration syntax and internal consistency without proposing resource changes; the second candidate terraform validate -json addresses emit machine-readable diagnostics for CI processing. This mapping fails because the first mechanism primarily supports the task to check configuration syntax and internal consistency without proposing resource changes and the second mechanism primarily supports the task to emit machine-readable diagnostics for CI processing; the actual requirements are emit machine-readable diagnostics for CI processing first and check configuration syntax and internal consistency without proposing resource changes second.
D:For the requested tasks to emit machine-readable diagnostics for CI processing and check configuration syntax and internal consistency without proposing resource changes, the first candidate Validate after initializing addresses avoid plugin-schema errors when checking a newly cloned configuration; the second candidate Validation of module inputs addresses catch an unsupported or missing required module argument early. This mapping fails because the first mechanism primarily supports the task to avoid plugin-schema errors when checking a newly cloned configuration and the second mechanism primarily supports the task to catch an unsupported or missing required module argument early; the actual requirements are emit machine-readable diagnostics for CI processing first and check configuration syntax and internal consistency without proposing resource changes second.
E:For the requested tasks to emit machine-readable diagnostics for CI processing and check configuration syntax and internal consistency without proposing resource changes, the first candidate Validation of module inputs addresses catch an unsupported or missing required module argument early; the second candidate terraform validate command addresses check configuration syntax and internal consistency without proposing resource changes. This mapping fails because the first mechanism primarily supports the task to catch an unsupported or missing required module argument early; the actual requirements are emit machine-readable diagnostics for CI processing first and check configuration syntax and internal consistency without proposing resource changes second.
Question 583
A Terraform rollout has two separate requirements: first, set backend storage for a root execution rather than independently in each child module; second, configure where a root module stores and accesses its state. Which assignment of mechanisms correctly handles both responsibilities?
- First use Backend partial configuration; then use terraform backend block.
- First use Backend configuration is root-only; then use Remote state centralization.
- First use Remote state centralization; then use Backend partial configuration.
- First use Backend configuration is root-only; then use terraform backend block.
- First use terraform backend block; then use Backend configuration is root-only.
Explanation
Correct Answer
D:The first requirement, to set backend storage for a root execution rather than independently in each child module, is handled by Backend configuration is root-only: The active root module configures the backend used by that Terraform working directory. The second requirement, to configure where a root module stores and accesses its state, is handled by terraform backend block: A backend block inside terraform settings specifies a supported state storage backend and its arguments. Each of these mechanisms has a distinct responsibility.
Incorrect Answers
A:For the requested tasks to set backend storage for a root execution rather than independently in each child module and configure where a root module stores and accesses its state, the first candidate Backend partial configuration addresses supply backend settings during init rather than hardcoding all values; the second candidate terraform backend block addresses configure where a root module stores and accesses its state. This mapping fails because the first mechanism primarily supports the task to supply backend settings during init rather than hardcoding all values; the actual requirements are set backend storage for a root execution rather than independently in each child module first and configure where a root module stores and accesses its state second.
B:For the requested tasks to set backend storage for a root execution rather than independently in each child module and configure where a root module stores and accesses its state, the first candidate Backend configuration is root-only addresses set backend storage for a root execution rather than independently in each child module; the second candidate Remote state centralization addresses keep a team deployment's current state in a shared backend. This mapping fails because the second mechanism primarily supports the task to keep a team deployment's current state in a shared backend; the actual requirements are set backend storage for a root execution rather than independently in each child module first and configure where a root module stores and accesses its state second.
C:For the requested tasks to set backend storage for a root execution rather than independently in each child module and configure where a root module stores and accesses its state, the first candidate Remote state centralization addresses keep a team deployment's current state in a shared backend; the second candidate Backend partial configuration addresses supply backend settings during init rather than hardcoding all values. 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 supply backend settings during init rather than hardcoding all values; the actual requirements are set backend storage for a root execution rather than independently in each child module first and configure where a root module stores and accesses its state second.
E:For the requested tasks to set backend storage for a root execution rather than independently in each child module and configure where a root module stores and accesses its state, the first candidate terraform backend block addresses configure where a root module stores and accesses its state; the second candidate Backend configuration is root-only addresses set backend storage for a root execution rather than independently in each child module. This mapping fails because the first mechanism primarily supports the task to configure where a root module stores and accesses its state and the second mechanism primarily supports the task to set backend storage for a root execution rather than independently in each child module; the actual requirements are set backend storage for a root execution rather than independently in each child module first and configure where a root module stores and accesses its state second.
Question 584
A design uses Optional object attribute to allow an object input to omit a field with an optional type specification. Which qualification applies to the named mechanism?
- An optional attribute is not the same as an entirely optional module input variable.
- Its schema is positional, unlike named fields of an object.
- It is distinct from a map requiring the same element type for all values.
- It is not the same as a set, where order is not meaningful.
Explanation
Correct Answer
A:For Optional object attribute in the task to allow an object input to omit a field with an optional type specification, the important caution is: An optional attribute is not the same as an entirely optional module input variable. The reason this matters is its actual behavior: optional(TYPE, DEFAULT) supports an omitted object attribute and can supply a default value.
Incorrect Answers
B:The proposed warning belongs to Tuple type, which serves the different goal to describe a fixed sequence with independently typed positions, rather than to Optional object attribute: tuple([...]) declares the expected type at each list position. The question concerns Optional object attribute acting to allow an object input to omit a field with an optional type specification, not a limit of Tuple type.
C:The proposed warning belongs to Object type, which serves the different goal to define a fixed schema of named attributes with declared types, rather than to Optional object attribute: object({...}) gives each named property a type, allowing heterogeneous fields. The question concerns Optional object attribute acting to allow an object input to omit a field with an optional type specification, not a limit of Object type.
D:The listed caution belongs specifically to List type, used to hold ordered values of a single element type: A list(T) preserves sequence and permits duplicates, with elements addressable by numeric index; the feature under review is instead Optional object attribute, so this answer attaches another feature's qualification to the wrong mechanism.
Question 585
A Terraform rollout has two separate requirements: first, keep implementation resources private while exposing a stable input and output interface; second, compose a reusable infrastructure component into a root configuration. Which assignment of mechanisms correctly handles both responsibilities?
- First use Multiple instances of one module; then use Module count meta-argument.
- First use Module block invocation; then use Module encapsulation.
- First use Module encapsulation; then use Module block invocation.
- First use Module encapsulation; then use Multiple instances of one module.
- First use Module count meta-argument; then use Module block invocation.
Explanation
Correct Answer
C:The first requirement, to keep implementation resources private while exposing a stable input and output interface, is handled by Module encapsulation: Modules promote reuse by letting callers depend on documented variables and outputs rather than every internal block. The second requirement, to compose a reusable infrastructure component into a root configuration, is handled by Module block invocation: A module block points at a source and supplies declared input arguments to a child module. Each of these mechanisms has a distinct responsibility.
Incorrect Answers
A:For the requested tasks to keep implementation resources private while exposing a stable input and output interface and compose a reusable infrastructure component into a root configuration, the first candidate Multiple instances of one module addresses deploy a common module separately for several named environments; the second candidate Module count meta-argument addresses optionally instantiate a module based on a count expression. This mapping fails because the first mechanism primarily supports the task to deploy a common module separately for several named environments and the second mechanism primarily supports the task to optionally instantiate a module based on a count expression; the actual requirements are keep implementation resources private while exposing a stable input and output interface first and compose a reusable infrastructure component into a root configuration second.
B:For the requested tasks to keep implementation resources private while exposing a stable input and output interface and compose a reusable infrastructure component into a root configuration, the first candidate Module block invocation addresses compose a reusable infrastructure component into a root configuration; the second candidate Module encapsulation addresses keep implementation resources private while exposing a stable input and output interface. This mapping fails because the first mechanism primarily supports the task to compose a reusable infrastructure component into a root configuration and the second mechanism primarily supports the task to keep implementation resources private while exposing a stable input and output interface; the actual requirements are keep implementation resources private while exposing a stable input and output interface first and compose a reusable infrastructure component into a root configuration second.
D:For the requested tasks to keep implementation resources private while exposing a stable input and output interface and compose a reusable infrastructure component into a root configuration, the first candidate Module encapsulation addresses keep implementation resources private while exposing a stable input and output interface; the second candidate Multiple instances of one module addresses deploy a common module separately for several named environments. This mapping fails because the second mechanism primarily supports the task to deploy a common module separately for several named environments; the actual requirements are keep implementation resources private while exposing a stable input and output interface first and compose a reusable infrastructure component into a root configuration second.
E:For the requested tasks to keep implementation resources private while exposing a stable input and output interface and compose a reusable infrastructure component into a root configuration, the first candidate Module count meta-argument addresses optionally instantiate a module based on a count expression; the second candidate Module block invocation addresses compose a reusable infrastructure component into a root configuration. This mapping fails because the first mechanism primarily supports the task to optionally instantiate a module based on a count expression; the actual requirements are keep implementation resources private while exposing a stable input and output interface first and compose a reusable infrastructure component into a root configuration second.
Question 586
A Terraform rollout has two separate requirements: first, align state ownership with a clearly defined infrastructure component; second, organize related workspaces and manage project-level access controls. Which assignment of mechanisms correctly handles both responsibilities?
- First use Workspace naming and ownership boundaries; then use Workspace placement within a project.
- First use Workspace naming and ownership boundaries; then use HCP Terraform project grouping.
- First use Workspace variable isolation; then use HCP Terraform project grouping.
- First use Workspace placement within a project; then use Workspace variable isolation.
- First use HCP Terraform project grouping; then use Workspace naming and ownership boundaries.
Explanation
Correct Answer
B:The first requirement, to align state ownership with a clearly defined infrastructure component, is handled by Workspace naming and ownership boundaries: Separate workspaces can represent distinct application stacks, environments, or ownership units. The second requirement, to organize related workspaces and manage project-level access controls, is handled by HCP Terraform project grouping: Projects group HCP Terraform workspaces so teams can delegate organization and access by project. Each of these mechanisms has a distinct responsibility.
Incorrect Answers
A:For the requested tasks to align state ownership with a clearly defined infrastructure component and organize related workspaces and manage project-level access controls, the first candidate Workspace naming and ownership boundaries addresses align state ownership with a clearly defined infrastructure component; the second candidate Workspace placement within a project addresses associate one infrastructure workspace with the correct organizational project. This mapping fails because the second mechanism primarily supports the task to associate one infrastructure workspace with the correct organizational project; the actual requirements are align state ownership with a clearly defined infrastructure component first and organize related workspaces and manage project-level access controls second.
C:For the requested tasks to align state ownership with a clearly defined infrastructure component and organize related workspaces and manage project-level access controls, the first candidate Workspace variable isolation addresses give development and production separate credentials and deployment values; the second candidate HCP Terraform project grouping addresses organize related workspaces and manage project-level access controls. This mapping fails because the first mechanism primarily supports the task to give development and production separate credentials and deployment values; the actual requirements are align state ownership with a clearly defined infrastructure component first and organize related workspaces and manage project-level access controls second.
D:For the requested tasks to align state ownership with a clearly defined infrastructure component and organize related workspaces and manage project-level access controls, the first candidate Workspace placement within a project addresses associate one infrastructure workspace with the correct organizational project; the second candidate Workspace variable isolation addresses give development and production separate credentials and deployment values. 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 give development and production separate credentials and deployment values; the actual requirements are align state ownership with a clearly defined infrastructure component first and organize related workspaces and manage project-level access controls second.
E:For the requested tasks to align state ownership with a clearly defined infrastructure component and organize related workspaces and manage project-level access controls, the first candidate HCP Terraform project grouping addresses organize related workspaces and manage project-level access controls; the second candidate Workspace naming and ownership boundaries addresses align state ownership with a clearly defined infrastructure component. This mapping fails because the first mechanism primarily supports the task to organize related workspaces and manage project-level access controls and the second mechanism primarily supports the task to align state ownership with a clearly defined infrastructure component; the actual requirements are align state ownership with a clearly defined infrastructure component first and organize related workspaces and manage project-level access controls second.
Question 587
A colleague recommends the Terraform concept "Plugin dependency installation". Which use case best matches it?
- resolve all referenced provider plugins before planning
- define the supported arguments and attributes for one resource type
- read remote information without declaring ownership of its lifecycle
- associate a resource with the default provider for its type prefix
Explanation
Correct Answer
A:The practical result of Plugin dependency installation, used to resolve all referenced provider plugins before planning, is: An initialized working directory has the plugins required for its configured resources and data sources. A qualification for this effect is: A provider is not a Terraform module downloaded from a module source.
Incorrect Answers
B:That outcome applies to Provider resource schema, intended to define the supported arguments and attributes for one resource type, rather than the question's feature Plugin dependency installation: The provider schema specifies which settings users can configure and which values are computed. Unlike Provider resource schema, Plugin dependency installation is intended to resolve all referenced provider plugins before planning, not to define the supported arguments and attributes for one resource type.
C:That outcome applies to Provider data sources, intended to read remote information without declaring ownership of its lifecycle, rather than the question's feature Plugin dependency installation: A provider data source queries external information that configuration can reference. Unlike Provider data sources, Plugin dependency installation is intended to resolve all referenced provider plugins before planning, not to read remote information without declaring ownership of its lifecycle.
D:That outcome applies to Provider selection for resource prefix, intended to associate a resource with the default provider for its type prefix, rather than the question's feature Plugin dependency installation: Without a provider meta-argument Terraform normally selects the matching local provider configuration. Unlike Provider selection for resource prefix, Plugin dependency installation is intended to resolve all referenced provider plugins before planning, not to associate a resource with the default provider for its type prefix.
Question 588
The implementation must both allow an object input to omit a field with an optional type specification and hold ordered values of a single element type. Which TWO mechanisms directly address these two separate requirements? Choose TWO.
- Object type
- Set type
- List type
- Map type
- Optional object attribute
Explanation
Correct Answers
C:Among the paired tasks to allow an object input to omit a field with an optional type specification and hold ordered values of a single element type, List type serves the requirement to hold ordered values of a single element type: A list(T) preserves sequence and permits duplicates, with elements addressable by numeric index. The other task must be covered by a separate mechanism.
E:Among the paired tasks to allow an object input to omit a field with an optional type specification and hold ordered values of a single element type, Optional object attribute serves the requirement to allow an object input to omit a field with an optional type specification: optional(TYPE, DEFAULT) supports an omitted object attribute and can supply a default value. The other task must be covered by a separate mechanism.
Incorrect Answers
A:The requirements are allow an object input to omit a field with an optional type specification and hold ordered values of a single element type, while Object type supports the different task to define a fixed schema of named attributes with declared types: object({...}) gives each named property a type, allowing heterogeneous fields. That capability is outside the two selected responsibilities.
B:The requirements are allow an object input to omit a field with an optional type specification and hold ordered values of a single element type, while Set type supports the different task to represent unique elements where ordering does not matter: A set(T) deduplicates members and does not guarantee a stable positional order. That capability is outside the two selected responsibilities.
D:The requirements are allow an object input to omit a field with an optional type specification and hold ordered values of a single element type, while Map type supports the different task to associate string keys with values of one element type: map(T) supports key-based lookup for values that share a type. That capability is outside the two selected responsibilities.
Question 589
A Terraform operator is specifically tasked to reject a proposed change whose behavior is unsafe even when HCL is valid. Which mechanism most directly meets this particular need?
- terraform validate command
- Validate after initializing
- Validation of module inputs
- Validation versus plan authorization
Explanation
Correct Answer
D:The task is to reject a proposed change whose behavior is unsafe even when HCL is valid; Validation versus plan authorization directly supports that requirement: Terraform validation verifies configuration well-formedness, not business policy or risk. Its relevant boundary is: Reviewing a plan or applying policy checks is a separate control.
Incorrect Answers
A:terraform validate command is designed to check configuration syntax and internal consistency without proposing resource changes, whereas this task is to reject a proposed change whose behavior is unsafe even when HCL is valid: terraform validate checks the configuration's structural validity in an initialized directory. Against Validation versus plan authorization, its limitation is: It does not verify remote credentials or guarantee an apply succeeds.
B:Validate after initializing is designed to avoid plugin-schema errors when checking a newly cloned configuration, whereas this task is to reject a proposed change whose behavior is unsafe even when HCL is valid: An initialized directory provides modules and provider schemas needed for full configuration validation. Against Validation versus plan authorization, its limitation is: Validation does not download missing plugins for itself.
C:Validation of module inputs is designed to catch an unsupported or missing required module argument early, whereas this task is to reject a proposed change whose behavior is unsafe even when HCL is valid: terraform validate can report module call errors that violate input or schema requirements. Against Validation versus plan authorization, its limitation is: Input values can still fail runtime preconditions or provider API constraints later.
Question 590
The deployment owner requests a reliable way to consume published output values from another Terraform state where supported. Which mechanism most directly meets this particular need?
- Data source for remote state outputs
- Backend credential management
- Backend migration workflow
- terraform backend block
Explanation
Correct Answer
A:The task is to consume published output values from another Terraform state where supported; Data source for remote state outputs directly supports that requirement: terraform_remote_state exposes root output values from a compatible existing state snapshot. Its relevant boundary is: Access to state metadata may expose more than the specific outputs, so permissions matter.
Incorrect Answers
B:Backend credential management is designed to authenticate backend access without embedding credentials in Terraform source, whereas this task is to consume published output values from another Terraform state where supported: Environment-based or supported identity-based backend credentials are generally safer than hardcoded values. Against Data source for remote state outputs, its limitation is: Backend credentials are distinct from provider API credentials.
C:Backend migration workflow is designed to move an existing state history when switching remote storage, whereas this task is to consume published output values from another Terraform state where supported: terraform init -migrate-state supports moving state during an intentional backend change. Against Data source for remote state outputs, its limitation is: The migration should be confirmed and tested to avoid splitting state histories.
D:terraform backend block addresses the different requirement to configure where a root module stores and accesses its state: A backend block inside terraform settings specifies a supported state storage backend and its arguments; this does not by itself satisfy the requested task to consume published output values from another Terraform state where supported. For the stated need, Data source for remote state outputs is the more direct mechanism.