Question 150
During one infrastructure delivery, the team must satisfy all of the following: (1) consume a module managed by the organization's HCP private registry; (2) delegate administration of one team's project without granting universal organization access. Select TWO appropriate Terraform approaches. Choose TWO.
- An HCP private registry module source
- HCP Terraform VCS integration
- Project-scoped team access
- Distinct production and staging workspaces
- HCP Terraform run tasks integration
- Dynamic provider credential integration
Explanation
Correct Answers
A:A module source can reference a private registry hostname and namespace after the client has appropriate authentication; this meets the requirement to consume a module managed by the organization's HCP private registry, while the other selected techniques address delegate administration of one team's project without granting universal organization access, which require their own distinct Terraform mechanisms.
C:Project-level access scopes workspace capabilities for teams based on organizational boundaries; this meets the requirement to delegate administration of one team's project without granting universal organization access, while the other selected techniques address consume a module managed by the organization's HCP private registry, which require their own distinct Terraform mechanisms.
Incorrect Answers
B:A VCS-connected workspace coordinates code changes, speculative plans and controlled applies through supported repository integration; it addresses connect reviewed repository commits to automated infrastructure plans, but this delivery instead requires consume a module managed by the organization's HCP private registry and delegate administration of one team's project without granting universal organization access. The required combination involves Project-scoped team access and An HCP private registry module source, not the behavior of HCP Terraform VCS integration.
D:Each HCP Terraform workspace has its own state and run configuration so changes in one do not automatically update the other; it addresses isolate state and runs for two deployment environments, but this delivery instead requires consume a module managed by the organization's HCP private registry and delegate administration of one team's project without granting universal organization access. The required combination involves Project-scoped team access and An HCP private registry module source, not the behavior of Distinct production and staging workspaces.
E:Run tasks integrate external systems into workflow checkpoints without changing the Terraform resource graph directly; it addresses send proposed changes to a third-party quality or security check service, but this delivery instead requires consume a module managed by the organization's HCP private registry and delegate administration of one team's project without granting universal organization access. The required combination involves Project-scoped team access and An HCP private registry module source, not the behavior of HCP Terraform run tasks integration.
F:Dynamic credentials integrate HCP Terraform with supported identity federation to obtain scoped run credentials; it addresses grant HCP runs temporary cloud authorization instead of long-lived static secrets, but this delivery instead requires consume a module managed by the organization's HCP private registry and delegate administration of one team's project without granting universal organization access. The required combination involves Project-scoped team access and An HCP private registry module source, not the behavior of Dynamic provider credential integration.
Question 151
A runbook lists “Importing without creating new infrastructure” for the task to take ownership of an existing object rather than duplicating it. Which technical effect should its description include?
- The experimental config-generation flag can write suggested resource declarations for review and correction before apply.
- Generated resource declarations are a starting point and can include computed or unsuitable attributes requiring manual cleanup.
- Imported infrastructure should have a corresponding resource block with configuration matching the desired attributes so the next plan is safe.
- The import workflow adds an existing remote object to state and can manage it through later plans instead of creating a replacement automatically.
Explanation
Correct Answer
D:The named mechanism is used when the objective is to take ownership of an existing object rather than duplicating it, so it produces the behavior described. In contrast, an import configuration review serves a different goal: correct provider-generated HCL rather than trusting every inferred argument, not take ownership of an existing object rather than duplicating it.
Incorrect Answers
A:The description applies to terraform plan -generate-config-out when an engineer needs to produce draft HCL for resources named in import blocks without matching configuration; the named importing without creating new infrastructure instead handles the requirement to take ownership of an existing object rather than duplicating it, so this behavior does not describe Importing without creating new infrastructure in the situation named.
B:The description applies to an import configuration review when an engineer needs to correct provider-generated HCL rather than trusting every inferred argument; the named importing without creating new infrastructure instead handles the requirement to take ownership of an existing object rather than duplicating it, so this behavior does not describe Importing without creating new infrastructure in the situation named.
C:The description applies to a matching resource declaration when an engineer needs to avoid unintended changes immediately after importing a remote object; the named importing without creating new infrastructure instead handles the requirement to take ownership of an existing object rather than duplicating it, so this behavior does not describe Importing without creating new infrastructure in the situation named.
Question 152
During a design review, the requirement is to supply a named collection of input assignments to Terraform. Which option should the engineer select?
- Apply failure recovery
- Apply a saved plan
- Apply with a .tfvars file
- Parallel graph execution
Explanation
Correct Answer
C:The -var-file option loads values from an input variables file, enabling separate environment assignments; this directly meets the requirement to supply a named collection of input assignments to Terraform. By comparison, apply a saved plan is intended to execute exactly the plan artifact that was reviewed, which is a different task from supply a named collection of input assignments to Terraform.
Incorrect Answers
A:A partial apply may have changed some resources, so Terraform should refresh and build a new plan rather than blindly assuming a full rollback; this mechanism is useful when the job is to inspect state and re-plan when a provider operation fails partway through, whereas the current scenario requires the engineer to supply a named collection of input assignments to Terraform. These operations have different effects in the stated Terraform workflow.
B:Passing the saved plan file to terraform apply uses its recorded choices; applying a plan file does not start a new interactive replanning step; this mechanism is useful when the job is to execute exactly the plan artifact that was reviewed, whereas the current scenario requires the engineer to supply a named collection of input assignments to Terraform. These operations have different effects in the stated Terraform workflow.
D:Terraform executes actions in graph order and can operate on independent nodes in parallel subject to provider and CLI limits; this mechanism is useful when the job is to allow independent resources to be applied concurrently, whereas the current scenario requires the engineer to supply a named collection of input assignments to Terraform. These operations have different effects in the stated Terraform workflow.
Question 153
The team evaluates “The import block” for a requirement to declare a managed import operation in configuration for planning and applying. Which observed behavior belongs to that mechanism rather than a different Terraform feature?
- A top-level import block identifies a target resource address and import identity so the operation participates in plan and apply.
- Import needs correct provider authentication and sufficient access to query the target resource using its provider-defined import ID.
- The import workflow adds an existing remote object to state and can manage it through later plans instead of creating a replacement automatically.
- Imported infrastructure should have a corresponding resource block with configuration matching the desired attributes so the next plan is safe.
Explanation
Correct Answer
A:The named mechanism is used when the objective is to declare a managed import operation in configuration for planning and applying, so it produces the behavior described. In contrast, importing without creating new infrastructure serves a different goal: take ownership of an existing object rather than duplicating it, not declare a managed import operation in configuration for planning and applying.
Incorrect Answers
B:The description applies to provider permissions during import when an engineer needs to read an existing cloud object so Terraform can associate it with state; the named the import block instead handles the requirement to declare a managed import operation in configuration for planning and applying, so this behavior does not describe The import block in the situation named.
C:The description applies to importing without creating new infrastructure when an engineer needs to take ownership of an existing object rather than duplicating it; the named the import block instead handles the requirement to declare a managed import operation in configuration for planning and applying, so this behavior does not describe The import block in the situation named.
D:The description applies to a matching resource declaration when an engineer needs to avoid unintended changes immediately after importing a remote object; the named the import block instead handles the requirement to declare a managed import operation in configuration for planning and applying, so this behavior does not describe The import block in the situation named.
Question 154
A team compares Terraform mechanisms for the goal to build a numbered name for each instance created using count. Which stated consequence belongs specifically to “count.index”?
- The syntax data.TYPE.NAME.ATTRIBUTE accesses attributes returned by an existing-object query.
- Resources using count can refer to the current instance number through count.index, a zero-based integer.
- An output block can use depends_on for dependencies that are not evident from its value expression.
- Parent configurations access child outputs using module.CHILD.OUTPUT; private child resource addresses are not automatically exported.
Explanation
Correct Answer
B:The named mechanism is used when the objective is to build a numbered name for each instance created using count, so it produces the behavior described. In contrast, a module output reference serves a different goal: use a child module's published value in a parent resource, not build a numbered name for each instance created using count.
Incorrect Answers
A:The description applies to a data attribute reference when an engineer needs to read a field from a configured data source in another expression; the named count.index instead handles the requirement to build a numbered name for each instance created using count, so this behavior does not describe count.index in the situation named.
C:The description applies to output dependency metadata when an engineer needs to delay the visibility of an output until additional required operations finish; the named count.index instead handles the requirement to build a numbered name for each instance created using count, so this behavior does not describe count.index in the situation named.
D:The description applies to a module output reference when an engineer needs to use a child module's published value in a parent resource; the named count.index instead handles the requirement to build a numbered name for each instance created using count, so this behavior does not describe count.index in the situation named.
Question 155
A team onboarding previously deployed infrastructure has a concrete implementation goal: avoid attaching two remote objects to the same Terraform resource address. What is the most appropriate Terraform mechanism?
- Importing without creating new infrastructure
- An import configuration review
- Separate resources for separate imports
- terraform plan -generate-config-out
Explanation
Correct Answer
C:Each managed remote object should have its own appropriate resource instance address so state can map objects unambiguously; this directly meets the requirement to avoid attaching two remote objects to the same Terraform resource address. By comparison, terraform plan -generate-config-out is intended to produce draft HCL for resources named in import blocks without matching configuration, which is a different task from avoid attaching two remote objects to the same Terraform resource address.
Incorrect Answers
A:The import workflow adds an existing remote object to state and can manage it through later plans instead of creating a replacement automatically; this mechanism is useful when the job is to take ownership of an existing object rather than duplicating it, whereas the current scenario requires the engineer to avoid attaching two remote objects to the same Terraform resource address. These operations have different effects in the stated Terraform workflow.
B:Generated resource declarations are a starting point and can include computed or unsuitable attributes requiring manual cleanup; this mechanism is useful when the job is to correct provider-generated HCL rather than trusting every inferred argument, whereas the current scenario requires the engineer to avoid attaching two remote objects to the same Terraform resource address. These operations have different effects in the stated Terraform workflow.
D:The experimental config-generation flag can write suggested resource declarations for review and correction before apply; this mechanism is useful when the job is to produce draft HCL for resources named in import blocks without matching configuration, whereas the current scenario requires the engineer to avoid attaching two remote objects to the same Terraform resource address. These operations have different effects in the stated Terraform workflow.
Question 156
A remote-state operations review needs to save a state-only refresh plan for review and later controlled application. Which feature or operation is the most direct match?
- A removed block with destroy=false
- terraform state mv
- Drift detection boundaries
- terraform plan -refresh-only -out=refresh.tfplan
Explanation
Correct Answer
D:Refresh-only planning previews proposed updates to state or root outputs without committing those updates; an apply is needed to persist them; this directly meets the requirement to save a state-only refresh plan for review and later controlled application. By comparison, terraform state mv is intended to change the address of a tracked object directly within state, which is a different task from save a state-only refresh plan for review and later controlled application.
Incorrect Answers
A:A removed block can intentionally forget the previous resource address without a provider delete when lifecycle destroy is false; this mechanism is useful when the job is to declare that a resource should leave management while its actual object is retained, whereas the current scenario requires the engineer to save a state-only refresh plan for review and later controlled application. These operations have different effects in the stated Terraform workflow.
B:The state mv command reassigns a managed resource's address without contacting the provider to destroy the object; this mechanism is useful when the job is to change the address of a tracked object directly within state, whereas the current scenario requires the engineer to save a state-only refresh plan for review and later controlled application. These operations have different effects in the stated Terraform workflow.
C:A plan does not discover every unmanaged object in an account; its normal focus is tracked resources and configured data sources; this mechanism is useful when the job is to understand that Terraform only examines infrastructure represented in its configuration or state scope, whereas the current scenario requires the engineer to save a state-only refresh plan for review and later controlled application. These operations have different effects in the stated Terraform workflow.
Question 157
A Terraform reviewer encounters “Isolating deployment boundaries” while assessing how to limit the impact of changes to one environment or platform. Which statement correctly describes its actual behavior?
- Each provider configuration supplies or discovers credentials appropriate to the API it calls, rather than sharing a universal Terraform credential.
- A shared Terraform language does not erase provider API differences; each provider defines supported resource schemas and behavior.
- Separate root modules and state files reduce shared-plan scope when different teams or lifecycles require isolation.
- Terraform can install different providers and let each manage its own service API within a single graph.
Explanation
Correct Answer
C:The named mechanism is used when the objective is to limit the impact of changes to one environment or platform, so it produces the behavior described. In contrast, provider-specific capabilities serves a different goal: avoid assuming that all providers expose identical resource types and options, not limit the impact of changes to one environment or platform.
Incorrect Answers
A:The description applies to provider authentication per service when an engineer needs to authorize Terraform separately for two different infrastructure APIs; the named isolating deployment boundaries instead handles the requirement to limit the impact of changes to one environment or platform, so this behavior does not describe Isolating deployment boundaries in the situation named.
B:The description applies to provider-specific capabilities when an engineer needs to avoid assuming that all providers expose identical resource types and options; the named isolating deployment boundaries instead handles the requirement to limit the impact of changes to one environment or platform, so this behavior does not describe Isolating deployment boundaries in the situation named.
D:The description applies to multiple provider requirements when an engineer needs to manage cloud resources and SaaS resources in one configuration; the named isolating deployment boundaries instead handles the requirement to limit the impact of changes to one environment or platform, so this behavior does not describe Isolating deployment boundaries in the situation named.
Question 158
A provider configuration review needs to preserve Terraform's knowledge of managed infrastructure between CLI runs. Which feature or operation is the most direct match?
- Remote state sharing boundaries
- Terraform refresh during planning
- State resource addresses
- State snapshots
Explanation
Correct Answer
D:The state snapshot records managed instance data and metadata needed to plan future actions; this directly meets the requirement to preserve Terraform's knowledge of managed infrastructure between CLI runs. By comparison, Terraform refresh during planning is intended to detect actual resource attributes rather than relying only on historical saved values, which is a different task from preserve Terraform's knowledge of managed infrastructure between CLI runs.
Incorrect Answers
A:Reading a remote state output still requires access to the underlying snapshot; exporting data through a narrower interface can reduce exposure; this concerns the task to avoid exposing full state when another stack only needs a published identifier, not the current need to preserve Terraform's knowledge of managed infrastructure between CLI runs. A State snapshots approach is appropriate here; the substituted Remote state sharing boundaries option does not supply the specified Terraform capability.
B:A normal plan attempts to refresh state from providers before comparing objects to the current configuration; this mechanism is useful when the job is to detect actual resource attributes rather than relying only on historical saved values, whereas the current scenario requires the engineer to preserve Terraform's knowledge of managed infrastructure between CLI runs. These operations have different effects in the stated Terraform workflow.
C:State maps Terraform instance addresses to remote object identifiers and remembered attributes for subsequent comparisons; this mechanism is useful when the job is to identify which remote object corresponds to a particular configuration resource, whereas the current scenario requires the engineer to preserve Terraform's knowledge of managed infrastructure between CLI runs. These operations have different effects in the stated Terraform workflow.
Question 159
The team evaluates “A resource's provider meta-argument” for a requirement to route a particular managed object to the named alternate provider configuration. Which observed behavior belongs to that mechanism rather than a different Terraform feature?
- List both plugins under required_providers and configure each service's provider independently as needed.
- The module call's providers argument maps the child's expected provider configuration name to a provider configuration available in the parent.
- Declare an aliased provider configuration and assign provider = provider_name.alias on resources that need the alternate region.
- The resource-level provider meta-argument selects a provider instance, not a different backend or Terraform workspace.
- A data block can set provider = aws.secondary to query through an alternate provider configuration.
Explanation
Correct Answer
D:The named mechanism is used when the objective is to route a particular managed object to the named alternate provider configuration, so it produces the behavior described. In contrast, explicit provider selection on data blocks serves a different goal: read an object from a secondary account rather than the default account, not route a particular managed object to the named alternate provider configuration.
Incorrect Answers
A:The description applies to separate required provider names when an engineer needs to use two unrelated service APIs in one root configuration; the named a resource's provider meta-argument instead handles the requirement to route a particular managed object to the named alternate provider configuration, so this behavior does not describe A resource's provider meta-argument in the situation named.
B:The description applies to the providers map on a module call when an engineer needs to pass an aliased provider configuration into a child module; the named a resource's provider meta-argument instead handles the requirement to route a particular managed object to the named alternate provider configuration, so this behavior does not describe A resource's provider meta-argument in the situation named.
C:The description applies to an aliased provider instance when an engineer needs to create resources in a second region using the same provider type; the named a resource's provider meta-argument instead handles the requirement to route a particular managed object to the named alternate provider configuration, so this behavior does not describe A resource's provider meta-argument in the situation named.
E:The description applies to explicit provider selection on data blocks when an engineer needs to read an object from a secondary account rather than the default account; the named a resource's provider meta-argument instead handles the requirement to route a particular managed object to the named alternate provider configuration, so this behavior does not describe A resource's provider meta-argument in the situation named.
Question 160
A Terraform reviewer encounters “for_each with a map” while assessing how to create instances using stable logical keys rather than shifting numeric indexes. Which statement correctly describes its actual behavior?
- The type constraint list(string) represents ordered string elements and supports numeric indexing, preserving element order.
- A resource's for_each meta-argument accepts maps or sets of strings; map keys appear in resource addresses.
- The set(string) type deduplicates values and does not preserve a meaningful input element order.
- An unknown value represents future information and can propagate through expressions until a provider supplies the result.
Explanation
Correct Answer
B:The named mechanism is used when the objective is to create instances using stable logical keys rather than shifting numeric indexes, so it produces the behavior described. In contrast, an unknown plan-time value serves a different goal: identify a computed attribute that Terraform cannot determine until apply, not create instances using stable logical keys rather than shifting numeric indexes.
Incorrect Answers
A:The description applies to a list of strings type when an engineer needs to accept an ordered collection of same-type string values; the named for_each with a map instead handles the requirement to create instances using stable logical keys rather than shifting numeric indexes, so this behavior does not describe for_each with a map in the situation named.
C:The description applies to a set of strings type when an engineer needs to store a collection with no duplicate members and no guaranteed order; the named for_each with a map instead handles the requirement to create instances using stable logical keys rather than shifting numeric indexes, so this behavior does not describe for_each with a map in the situation named.
D:The description applies to an unknown plan-time value when an engineer needs to identify a computed attribute that Terraform cannot determine until apply; the named for_each with a map instead handles the requirement to create instances using stable logical keys rather than shifting numeric indexes, so this behavior does not describe for_each with a map in the situation named.