Question 60
In a planned migration, the requested result is to supply credentials and settings needed for remote API requests. What should the engineer select?
- Configure a provider's authentication
- Distinguish Terraform Core from provider plugins
- Review provider documentation for sensitive attributes
- Recognize provider source addresses
- Read provider-computed attributes
Explanation
Correct Answer
A:Provider configuration determines how the plugin connects to its service; defining the plugin requirement alone is not sufficient for authenticated resource operations; this behavior should be assessed against the concrete need to supply credentials and settings needed for remote API requests. This directly supports the task to supply credentials and settings needed for remote API requests during a deployment checklist.
Incorrect Answers
B:Core evaluates configuration and plans operations; a provider talks to its specific API to create, read, update, or delete objects; an API authorization error therefore usually needs provider-side credential review; this behavior should be assessed against the concrete need to supply credentials and settings needed for remote API requests. That can be useful when the aim is to locate graph, evaluation, state, and orchestration responsibilities, but it does not directly deliver the requested ability to supply credentials and settings needed for remote API requests.
C:Providers decide which schema values are stored, sensitive in display, or write-only; hiding a value in output is not equivalent to omitting it from state; this behavior should be assessed against the concrete need to supply credentials and settings needed for remote API requests. The distinction matters here: using that mechanism to avoid assuming ordinary resource arguments hide secrets from state would still leave the objective to supply credentials and settings needed for remote API requests unmet.
D:The source includes registry host, namespace, and type when fully qualified; local names let modules refer to that provider without repeating its entire address; this behavior should be assessed against the concrete need to supply credentials and settings needed for remote API requests. It may support a related workflow, but the question specifically requires the mechanism for supply credentials and settings needed for remote API requests rather than distinguish a local provider name from its registry namespace.
E:A provider may return IDs or addresses that were unknown during initial planning; terraform can propagate unknown values through references until the apply produces them; this behavior should be assessed against the concrete need to supply credentials and settings needed for remote API requests. The stated requirement is to supply credentials and settings needed for remote API requests, not to use values learned only after resource creation or refresh; this alternative addresses a different control or phase.
Question 61
An IaC repository is targeting several accounts or regions. The team must both document the plugin source and compatibility constraints inside each module and keep configurations controlled by the root for compatible module reuse. Which paired choice implements those distinct goals?
- Declare
required_providers separately in a child module + Pass a providers map in a module call
- Declare
required_providers separately in a child module + Avoid provider blocks inside reusable child modules
- Define an aliased
provider block + Avoid provider blocks inside reusable child modules
- Reference a provider alias without quotation marks + Understand the implied empty default provider configuration
Explanation
Correct Answer
B:For the first criterion, provider configurations may be passed across modules, but source and version requirements are local to each module; explicit requirements prevent incorrect provider-source inference; this behavior should be assessed against the concrete need to document the plugin source and compatibility constraints inside each module and keep configurations controlled by the root for compatible module reuse; this directly addresses the need to document the plugin source and compatibility constraints inside each module. For the separate second criterion, child modules designed for reuse should receive provider configurations from callers; embedded provider blocks conflict with some module meta-arguments, including for_each; this behavior should be assessed against the concrete need to document the plugin source and compatibility constraints inside each module and keep configurations controlled by the root for compatible module reuse; this fulfills the need to keep configurations controlled by the root for compatible module reuse. Together they cover the independent tasks of document the plugin source and compatibility constraints inside each module and keep configurations controlled by the root for compatible module reuse without exchanging the responsibilities of these features.
Incorrect Answers
A:The first measure meets the requirement to document the plugin source and compatibility constraints inside each module, but its partner serves a different role: Module provider mappings decide which configurations each child resource receives; the entries reference provider instances, not plain strings of region names; this behavior should be assessed against the concrete need to document the plugin source and compatibility constraints inside each module and keep configurations controlled by the root for compatible module reuse. That second component is designed to map a child module's expected provider names to root configurations, so the still-missing criterion is to keep configurations controlled by the root for compatible module reuse, while the first criterion remains document the plugin source and compatibility constraints inside each module.
C:The second measure does meet the keep configurations controlled by the root for compatible module reuse requirement, but the first is designed for another concern: An alias identifies an alternate configuration such as another region; it does not register a different plugin source or version by itself; this behavior should be assessed against the concrete need to document the plugin source and compatibility constraints inside each module and keep configurations controlled by the root for compatible module reuse. That first component is designed to create a second named configuration of the same provider, which does not accomplish the requested task to document the plugin source and compatibility constraints inside each module, even though the other measure satisfies keep configurations controlled by the root for compatible module reuse.
D:The first measure is intended to write the meta-argument as a provider configuration reference: Syntax such as provider = aws.west names the configuration; putting the reference in a string changes it from a provider reference and is not valid usage; this behavior should be assessed against the concrete need to document the plugin source and compatibility constraints inside each module and keep configurations controlled by the root for compatible module reuse. The second measure is intended to diagnose failures when only aliases are configured: If all provider blocks use aliases, resources without an explicit provider may fall back to an implied empty default; required settings then may be missing; this behavior should be assessed against the concrete need to document the plugin source and compatibility constraints inside each module and keep configurations controlled by the root for compatible module reuse. Neither is the directly designated method for the separate goals of document the plugin source and compatibility constraints inside each module and keep configurations controlled by the root for compatible module reuse in this review.
Question 62
A developer is comparing configuration, state, and current infrastructure. Two independent changes are requested: first, prevent unauthorized access to stored resource attributes; second, preserve internal consistency of resource instance mappings. Which pair of measures fulfills both?
- Protect state as sensitive material + Avoid manual state-file editing
- Protect state as sensitive material + Identify stale state after out-of-band edits
- Understand one state per workspace boundary + Avoid manual state-file editing
- Treat state as the resource-address-to-object mapping + Treat state snapshots as recoverable but hazardous
Explanation
Correct Answer
A:For the first criterion, state can hold secrets and identifiers even when CLI output masks a sensitive value; encryption and strict backend access control are important; this behavior should be assessed against the concrete need to prevent unauthorized access to stored resource attributes and preserve internal consistency of resource instance mappings; this directly addresses the need to prevent unauthorized access to stored resource attributes. For the separate second criterion, terraform state operations and declarative moved/removed blocks are safer tools for intended transitions; hand-editing state can corrupt identifiers or dependencies; this behavior should be assessed against the concrete need to prevent unauthorized access to stored resource attributes and preserve internal consistency of resource instance mappings; this fulfills the need to preserve internal consistency of resource instance mappings. Together they cover the independent tasks of prevent unauthorized access to stored resource attributes and preserve internal consistency of resource instance mappings without exchanging the responsibilities of these features.
Incorrect Answers
B:The first measure meets the requirement to prevent unauthorized access to stored resource attributes, but its partner serves a different role: When someone alters a tracked object directly, current cloud attributes can differ from state and configuration; terraform surfaces reconciliation actions during planning; this behavior should be assessed against the concrete need to prevent unauthorized access to stored resource attributes and preserve internal consistency of resource instance mappings. That second component is designed to explain why plans may propose correcting unapproved changes, so the still-missing criterion is to preserve internal consistency of resource instance mappings, while the first criterion remains prevent unauthorized access to stored resource attributes.
C:The second measure does meet the preserve internal consistency of resource instance mappings requirement, but the first is designed for another concern: Different Terraform states maintain separate bindings and resource addresses; a shared configuration can therefore manage multiple environments if each has isolated state and inputs; this behavior should be assessed against the concrete need to prevent unauthorized access to stored resource attributes and preserve internal consistency of resource instance mappings. That first component is designed to avoid mixing independent deployments unintentionally, which does not accomplish the requested task to prevent unauthorized access to stored resource attributes, even though the other measure satisfies preserve internal consistency of resource instance mappings.
D:The first measure is intended to identify which remote object Terraform currently manages for a resource block: State binds addresses in configuration to provider-specific remote IDs and recorded attributes; without that mapping Terraform cannot reliably correlate every declared block with an existing object; this behavior should be assessed against the concrete need to prevent unauthorized access to stored resource attributes and preserve internal consistency of resource instance mappings. The second measure is intended to plan how to protect, back up, and restore state deliberately: An invalid or outdated state snapshot can confuse planned operations; recovery needs controlled version handling, not arbitrary deletion of an active backend; this behavior should be assessed against the concrete need to prevent unauthorized access to stored resource attributes and preserve internal consistency of resource instance mappings. Neither is the directly designated method for the separate goals of prevent unauthorized access to stored resource attributes and preserve internal consistency of resource instance mappings in this review.
Question 63
In a planned migration, the requested result is to record selected provider releases and package checksums across machines. What should the engineer select?
- Constrain
required_version for Terraform Core
- Run
terraform init to install plugins
- Distinguish provider requirements from provider configurations
- Use
terraform init -lockfile=readonly in CI
- Commit
.terraform.lock.hcl for reproducibility
Explanation
Correct Answer
E:The dependency lock file constrains selection in later runs and verifies packages; it is not a lock for module releases or a storage location for state; this behavior should be assessed against the concrete need to record selected provider releases and package checksums across machines. This directly supports the task to record selected provider releases and package checksums across machines during a deployment checklist.
Incorrect Answers
A:The top-level Terraform version constraint concerns the CLI executable, not a provider plugin; provider requirements belong in required_providers; this behavior should be assessed against the concrete need to record selected provider releases and package checksums across machines. The distinction matters here: using that mechanism to specify which Terraform CLI versions may interpret this configuration would still leave the objective to record selected provider releases and package checksums across machines unmet.
B:Initialization resolves provider requirements and places plugin packages into the local cache or working data directory. plan assumes required initialization has occurred; this behavior should be assessed against the concrete need to record selected provider releases and package checksums across machines. It may support a related workflow, but the question specifically requires the mechanism for record selected provider releases and package checksums across machines rather than download and initialize missing required providers.
C:required_providers selects a plugin identity and versions; provider blocks hold instance settings such as region, endpoint, or authentication; this behavior should be assessed against the concrete need to record selected provider releases and package checksums across machines. The stated requirement is to record selected provider releases and package checksums across machines, not to separate which plugin to install from how it authenticates and connects; this alternative addresses a different control or phase.
D:Read-only mode checks the selections already committed and fails if changes are needed; it is useful for strict repeatable pipelines, not for upgrading providers; this behavior should be assessed against the concrete need to record selected provider releases and package checksums across machines. That can be useful when the aim is to prevent dependency initialization from changing the committed lock file, but it does not directly deliver the requested ability to record selected provider releases and package checksums across machines.
Question 64
An engineer needs to separate provider release changes from upgrading Terraform CLI as part of a planned migration. Which option is the best fit?
- Handle provider-specific constraints
- Understand a provider plugin's version independence
- Configure a provider's authentication
- Review provider documentation for sensitive attributes
- Recognize provider source addresses
Explanation
Correct Answer
B:A provider is distributed and versioned independently of Terraform Core; compatibility constraints may restrict usable combinations; this behavior should be assessed against the concrete need to separate provider release changes from upgrading Terraform CLI. This directly supports the task to separate provider release changes from upgrading Terraform CLI during a maintenance request.
Incorrect Answers
A:Each service API determines supported operations, defaults, quotas, and replacement rules; the shared HCL syntax does not standardize these platform behaviors; this behavior should be assessed against the concrete need to separate provider release changes from upgrading Terraform CLI. That can be useful when the aim is to avoid assuming one cloud plugin exposes the same resource semantics as another, but it does not directly deliver the requested ability to separate provider release changes from upgrading Terraform CLI.
C:Provider configuration determines how the plugin connects to its service; defining the plugin requirement alone is not sufficient for authenticated resource operations; this behavior should be assessed against the concrete need to separate provider release changes from upgrading Terraform CLI. It may support a related workflow, but the question specifically requires the mechanism for separate provider release changes from upgrading Terraform CLI rather than supply credentials and settings needed for remote API requests.
D:Providers decide which schema values are stored, sensitive in display, or write-only; hiding a value in output is not equivalent to omitting it from state; this behavior should be assessed against the concrete need to separate provider release changes from upgrading Terraform CLI. The stated requirement is to separate provider release changes from upgrading Terraform CLI, not to avoid assuming ordinary resource arguments hide secrets from state; this alternative addresses a different control or phase.
E:The source includes registry host, namespace, and type when fully qualified; local names let modules refer to that provider without repeating its entire address; this behavior should be assessed against the concrete need to separate provider release changes from upgrading Terraform CLI. That can be useful when the aim is to distinguish a local provider name from its registry namespace, but it does not directly deliver the requested ability to separate provider release changes from upgrading Terraform CLI.
Question 65
A shared module needs more than one provider configuration. Two independent changes are requested: first, ensure reads occur in the intended service account or region; second, support a module that must address source and destination environments. Which pair of measures fulfills both?
- Bind a data source to the appropriate provider alias + Map multiple aliases for a cross-region child module
- Bind a data source to the appropriate provider alias + Inherit the default provider configuration into a child module
- Understand the implied empty default provider configuration + Map multiple aliases for a cross-region child module
- Bind a data source to the appropriate provider alias + Use different local provider names for distinct plugin sources
- Declare
configuration_aliases in a child module + Define an aliased provider block
- Avoid provider blocks inside reusable child modules + Map multiple aliases for a cross-region child module
Explanation
Correct Answer
A:For the first criterion, data sources accept provider selection as managed resources do; a lookup against the wrong default configuration may return the wrong object or no object; this behavior should be assessed against the concrete need to ensure reads occur in the intended service account or region and support a module that must address source and destination environments; this directly addresses the need to ensure reads occur in the intended service account or region. For the separate second criterion, a child can declare distinct alias names and the caller can bind each one to a separate root configuration; passing a single default is insufficient for a two-context design; this behavior should be assessed against the concrete need to ensure reads occur in the intended service account or region and support a module that must address source and destination environments; this fulfills the need to support a module that must address source and destination environments. Together they cover the independent tasks of ensure reads occur in the intended service account or region and support a module that must address source and destination environments without exchanging the responsibilities of these features.
Incorrect Answers
B:The first measure meets the requirement to ensure reads occur in the intended service account or region, but its partner serves a different role: Child modules generally inherit default provider configurations when not overridden; aliased configurations are not inherited automatically; this behavior should be assessed against the concrete need to ensure reads occur in the intended service account or region and support a module that must address source and destination environments. That second component is designed to use the parent's ordinary provider settings without manual remapping, so the still-missing criterion is to support a module that must address source and destination environments, while the first criterion remains ensure reads occur in the intended service account or region.
C:The second measure does meet the support a module that must address source and destination environments requirement, but the first is designed for another concern: If all provider blocks use aliases, resources without an explicit provider may fall back to an implied empty default; required settings then may be missing; this behavior should be assessed against the concrete need to ensure reads occur in the intended service account or region and support a module that must address source and destination environments. That first component is designed to diagnose failures when only aliases are configured, which does not accomplish the requested task to ensure reads occur in the intended service account or region, even though the other measure satisfies support a module that must address source and destination environments.
D:The first measure meets the requirement to ensure reads occur in the intended service account or region, but its partner serves a different role: The local name maps a provider source to an identifier in a module; two sources require distinct local names even if their human-facing functions overlap; this behavior should be assessed against the concrete need to ensure reads occur in the intended service account or region and support a module that must address source and destination environments. That second component is designed to avoid confusing multiple plugins with the same type suffix, so the still-missing criterion is to support a module that must address source and destination environments, while the first criterion remains ensure reads occur in the intended service account or region.
E:The first measure is intended to make additional provider configuration names available to child resources: A reusable module must declare aliases it expects in provider requirements; the caller can then pass those configurations through its module block; this behavior should be assessed against the concrete need to ensure reads occur in the intended service account or region and support a module that must address source and destination environments. The second measure is intended to create a second named configuration of the same provider: An alias identifies an alternate configuration such as another region; it does not register a different plugin source or version by itself; this behavior should be assessed against the concrete need to ensure reads occur in the intended service account or region and support a module that must address source and destination environments. Neither is the directly designated method for the separate goals of ensure reads occur in the intended service account or region and support a module that must address source and destination environments in this review.
F:The second measure does meet the support a module that must address source and destination environments requirement, but the first is designed for another concern: Child modules designed for reuse should receive provider configurations from callers; embedded provider blocks conflict with some module meta-arguments, including for_each; this behavior should be assessed against the concrete need to ensure reads occur in the intended service account or region and support a module that must address source and destination environments. That first component is designed to keep configurations controlled by the root for compatible module reuse, which does not accomplish the requested task to ensure reads occur in the intended service account or region, even though the other measure satisfies support a module that must address source and destination environments.
Question 66
An administrator needs to understand a plan that touches existing objects. A reviewer must determine how to retain references needed to reconcile previously created resources. Which action is the appropriate choice?
- Use state for dependency information
- Understand refresh during planning
- Use a remote backend for shared state
- Treat state as the resource-address-to-object mapping
Explanation
Correct Answer
A:State helps Terraform track relationships and objects that may no longer be present in configuration; its purpose extends beyond saving a copy of HCL source code; this behavior should be assessed against the concrete need to retain references needed to reconcile previously created resources. This directly supports the task to retain references needed to reconcile previously created resources during a staged rollout.
Incorrect Answers
B:Terraform typically reads managed remote objects to update its knowledge before making a normal plan; the refresh may reveal drift introduced outside Terraform; this behavior should be assessed against the concrete need to retain references needed to reconcile previously created resources. The stated requirement is to retain references needed to reconcile previously created resources, not to compare tracked objects against current provider-reported attributes; this alternative addresses a different control or phase.
C:Remote backends centralize state storage and may offer locking; sharing a state file via Git is not an equivalent concurrency or secret-management solution; this behavior should be assessed against the concrete need to retain references needed to reconcile previously created resources. That can be useful when the aim is to make one authoritative state accessible to a collaborating team, but it does not directly deliver the requested ability to retain references needed to reconcile previously created resources.
D:State binds addresses in configuration to provider-specific remote IDs and recorded attributes; without that mapping Terraform cannot reliably correlate every declared block with an existing object; this behavior should be assessed against the concrete need to retain references needed to reconcile previously created resources. The distinction matters here: using that mechanism to identify which remote object Terraform currently manages for a resource block would still leave the objective to retain references needed to reconcile previously created resources unmet.
Question 67
A Terraform repository is introducing a provider upgrade policy. The team must both restrict which plugin releases are eligible for installation and record selected provider releases and package checksums across machines. Which paired choice implements those distinct goals?
- Declare provider source under
required_providers + Use terraform init -lockfile=readonly in CI
- Diagnose an incompatible version constraint intersection + Commit
.terraform.lock.hcl for reproducibility
- Use
TF_PLUGIN_CACHE_DIR for shared package caching + Commit .terraform.lock.hcl for reproducibility
- Set a provider version constraint + Understand checksums in the lock file
- Set a provider version constraint + Commit
.terraform.lock.hcl for reproducibility
Explanation
Correct Answer
E:For the first criterion, a constraint such as ~> 5.0 filters available versions by compatibility; it is not a request to install any arbitrarily newer major version; this behavior should be assessed against the concrete need to restrict which plugin releases are eligible for installation and record selected provider releases and package checksums across machines; this directly addresses the need to restrict which plugin releases are eligible for installation. For the separate second criterion, the dependency lock file constrains selection in later runs and verifies packages; it is not a lock for module releases or a storage location for state; this behavior should be assessed against the concrete need to restrict which plugin releases are eligible for installation and record selected provider releases and package checksums across machines; this fulfills the need to record selected provider releases and package checksums across machines. Together they cover the independent tasks of restrict which plugin releases are eligible for installation and record selected provider releases and package checksums across machines without exchanging the responsibilities of these features.
Incorrect Answers
A:The first measure is intended to identify the registry namespace and provider type to install: The source address identifies the plugin distribution; a local short name in HCL is only an alias within that module; terraform must resolve provider requirements during initialization; this behavior should be assessed against the concrete need to restrict which plugin releases are eligible for installation and record selected provider releases and package checksums across machines. The second measure is intended to prevent dependency initialization from changing the committed lock file: Read-only mode checks the selections already committed and fails if changes are needed; it is useful for strict repeatable pipelines, not for upgrading providers; this behavior should be assessed against the concrete need to restrict which plugin releases are eligible for installation and record selected provider releases and package checksums across machines. Neither is the directly designated method for the separate goals of restrict which plugin releases are eligible for installation and record selected provider releases and package checksums across machines in this review.
B:The second measure does meet the record selected provider releases and package checksums across machines requirement, but the first is designed for another concern: Terraform must choose a provider version satisfying all relevant module requirements; contradictory ranges cause initialization failure rather than silent dual-version installation of the same source; this behavior should be assessed against the concrete need to restrict which plugin releases are eligible for installation and record selected provider releases and package checksums across machines. That first component is designed to recognize why two modules can prevent provider resolution, which does not accomplish the requested task to restrict which plugin releases are eligible for installation, even though the other measure satisfies record selected provider releases and package checksums across machines.
C:The second measure does meet the record selected provider releases and package checksums across machines requirement, but the first is designed for another concern: A plugin cache can reduce download work across directories; it does not replace the dependency lock file's selections and package-verification responsibilities; this behavior should be assessed against the concrete need to restrict which plugin releases are eligible for installation and record selected provider releases and package checksums across machines. That first component is designed to avoid repeatedly downloading the same provider binaries on a build host, which does not accomplish the requested task to restrict which plugin releases are eligible for installation, even though the other measure satisfies record selected provider releases and package checksums across machines.
D:The first measure meets the requirement to restrict which plugin releases are eligible for installation, but its partner serves a different role: Hashes help detect unexpected package changes; they do not validate that a plugin's credentials have sufficient rights at a remote API; this behavior should be assessed against the concrete need to restrict which plugin releases are eligible for installation and record selected provider releases and package checksums across machines. That second component is designed to verify installed provider packages against trusted recorded hashes, so the still-missing criterion is to record selected provider releases and package checksums across machines, while the first criterion remains restrict which plugin releases are eligible for installation.
Question 68
A provider integration encounters an API permission problem. The requirement is to understand how an unqualified resource chooses its default provider. Which Terraform mechanism directly meets this requirement?
- Distinguish Terraform Core from provider plugins
- Review provider documentation for sensitive attributes
- Select a provider using the resource type prefix
- Recognize a provider as an API plugin
- Handle provider-specific constraints
Explanation
Correct Answer
C:A type such as aws_instance typically maps to the default local provider name aws; an explicit provider meta-argument can override that default configuration; this behavior should be assessed against the concrete need to understand how an unqualified resource chooses its default provider. This directly supports the task to understand how an unqualified resource chooses its default provider during an automated release.
Incorrect Answers
A:Core evaluates configuration and plans operations; a provider talks to its specific API to create, read, update, or delete objects; an API authorization error therefore usually needs provider-side credential review; this behavior should be assessed against the concrete need to understand how an unqualified resource chooses its default provider. The distinction matters here: using that mechanism to locate graph, evaluation, state, and orchestration responsibilities would still leave the objective to understand how an unqualified resource chooses its default provider unmet.
B:Providers decide which schema values are stored, sensitive in display, or write-only; hiding a value in output is not equivalent to omitting it from state; this behavior should be assessed against the concrete need to understand how an unqualified resource chooses its default provider. It may support a related workflow, but the question specifically requires the mechanism for understand how an unqualified resource chooses its default provider rather than avoid assuming ordinary resource arguments hide secrets from state.
D:Provider binaries translate resource and data-source lifecycle requests into service-specific API calls; terraform Core builds plans and tracks dependencies, rather than implementing every cloud API directly; this behavior should be assessed against the concrete need to understand how an unqualified resource chooses its default provider. That can be useful when the aim is to map Terraform resource operations to a platform's API, but it does not directly deliver the requested ability to understand how an unqualified resource chooses its default provider.
E:Each service API determines supported operations, defaults, quotas, and replacement rules; the shared HCL syntax does not standardize these platform behaviors; this behavior should be assessed against the concrete need to understand how an unqualified resource chooses its default provider. The distinction matters here: using that mechanism to avoid assuming one cloud plugin exposes the same resource semantics as another would still leave the objective to understand how an unqualified resource chooses its default provider unmet.
Question 69
During a deployment checklist, one task is to create a second named configuration of the same provider, while another is to map a child module's expected provider names to root configurations. Select the matching pair of techniques.
- Define an aliased
provider block + Set provider = aws.west on a resource
- Use different local provider names for distinct plugin sources + Pass a
providers map in a module call
- Define an aliased
provider block + Pass a providers map in a module call
- Define an aliased
provider block + Declare required_providers separately in a child module
- Reference a provider alias without quotation marks + Pass a
providers map in a module call
- Bind a data source to the appropriate provider alias + Declare
configuration_aliases in a child module
Explanation
Correct Answer
C:For the first criterion, an alias identifies an alternate configuration such as another region; it does not register a different plugin source or version by itself; this behavior should be assessed against the concrete need to create a second named configuration of the same provider and map a child module's expected provider names to root configurations; this directly addresses the need to create a second named configuration of the same provider. For the separate second criterion, module provider mappings decide which configurations each child resource receives; the entries reference provider instances, not plain strings of region names; this behavior should be assessed against the concrete need to create a second named configuration of the same provider and map a child module's expected provider names to root configurations; this fulfills the need to map a child module's expected provider names to root configurations. Together they cover the independent tasks of create a second named configuration of the same provider and map a child module's expected provider names to root configurations without exchanging the responsibilities of these features.
Incorrect Answers
A:The first measure meets the requirement to create a second named configuration of the same provider, but its partner serves a different role: The provider meta-argument is a reference to a configured provider instance; without it, a resource normally selects its type's default provider; this behavior should be assessed against the concrete need to create a second named configuration of the same provider and map a child module's expected provider names to root configurations. That second component is designed to bind an individual resource to a nondefault provider configuration, so the still-missing criterion is to map a child module's expected provider names to root configurations, while the first criterion remains create a second named configuration of the same provider.
B:The second measure does meet the map a child module's expected provider names to root configurations requirement, but the first is designed for another concern: The local name maps a provider source to an identifier in a module; two sources require distinct local names even if their human-facing functions overlap; this behavior should be assessed against the concrete need to create a second named configuration of the same provider and map a child module's expected provider names to root configurations. That first component is designed to avoid confusing multiple plugins with the same type suffix, which does not accomplish the requested task to create a second named configuration of the same provider, even though the other measure satisfies map a child module's expected provider names to root configurations.
D:The first measure meets the requirement to create a second named configuration of the same provider, but its partner serves a different role: Provider configurations may be passed across modules, but source and version requirements are local to each module; explicit requirements prevent incorrect provider-source inference; this behavior should be assessed against the concrete need to create a second named configuration of the same provider and map a child module's expected provider names to root configurations. That second component is designed to document the plugin source and compatibility constraints inside each module, so the still-missing criterion is to map a child module's expected provider names to root configurations, while the first criterion remains create a second named configuration of the same provider.
E:The second measure does meet the map a child module's expected provider names to root configurations requirement, but the first is designed for another concern: Syntax such as provider = aws.west names the configuration; putting the reference in a string changes it from a provider reference and is not valid usage; this behavior should be assessed against the concrete need to create a second named configuration of the same provider and map a child module's expected provider names to root configurations. That first component is designed to write the meta-argument as a provider configuration reference, which does not accomplish the requested task to create a second named configuration of the same provider, even though the other measure satisfies map a child module's expected provider names to root configurations.
F:The first measure is intended to ensure reads occur in the intended service account or region: Data sources accept provider selection as managed resources do; a lookup against the wrong default configuration may return the wrong object or no object; this behavior should be assessed against the concrete need to create a second named configuration of the same provider and map a child module's expected provider names to root configurations. The second measure is intended to make additional provider configuration names available to child resources: A reusable module must declare aliases it expects in provider requirements; the caller can then pass those configurations through its module block; this behavior should be assessed against the concrete need to create a second named configuration of the same provider and map a child module's expected provider names to root configurations. Neither is the directly designated method for the separate goals of create a second named configuration of the same provider and map a child module's expected provider names to root configurations in this review.
Question 70
A reviewer has to approve a two-part design: retain references needed to reconcile previously created resources; additionally, plan how to protect, back up, and restore state deliberately. Which option pairs the correct mechanisms?
- Treat state as the resource-address-to-object mapping + Treat state snapshots as recoverable but hazardous
- Use state for dependency information + Separate state from the desired configuration
- Identify stale state after out-of-band edits + Use a remote backend for shared state
- Use state for dependency information + Treat state snapshots as recoverable but hazardous
Explanation
Correct Answer
D:For the first criterion, state helps Terraform track relationships and objects that may no longer be present in configuration; its purpose extends beyond saving a copy of HCL source code; this behavior should be assessed against the concrete need to retain references needed to reconcile previously created resources and plan how to protect, back up, and restore state deliberately; this directly addresses the need to retain references needed to reconcile previously created resources. For the separate second criterion, an invalid or outdated state snapshot can confuse planned operations; recovery needs controlled version handling, not arbitrary deletion of an active backend; this behavior should be assessed against the concrete need to retain references needed to reconcile previously created resources and plan how to protect, back up, and restore state deliberately; this fulfills the need to plan how to protect, back up, and restore state deliberately. Together they cover the independent tasks of retain references needed to reconcile previously created resources and plan how to protect, back up, and restore state deliberately without exchanging the responsibilities of these features.
Incorrect Answers
A:The second measure does meet the plan how to protect, back up, and restore state deliberately requirement, but the first is designed for another concern: State binds addresses in configuration to provider-specific remote IDs and recorded attributes; without that mapping Terraform cannot reliably correlate every declared block with an existing object; this behavior should be assessed against the concrete need to retain references needed to reconcile previously created resources and plan how to protect, back up, and restore state deliberately. That first component is designed to identify which remote object Terraform currently manages for a resource block, which does not accomplish the requested task to retain references needed to reconcile previously created resources, even though the other measure satisfies plan how to protect, back up, and restore state deliberately.
B:The first measure meets the requirement to retain references needed to reconcile previously created resources, but its partner serves a different role: Configuration declares intended resources while state records what Terraform tracks; removing a block can plan destruction unless a supported removal mechanism changes that intent; this behavior should be assessed against the concrete need to retain references needed to reconcile previously created resources and plan how to protect, back up, and restore state deliberately. That second component is designed to recognize that a state entry is not a request to keep an object forever, so the still-missing criterion is to plan how to protect, back up, and restore state deliberately, while the first criterion remains retain references needed to reconcile previously created resources.
C:The first measure is intended to explain why plans may propose correcting unapproved changes: When someone alters a tracked object directly, current cloud attributes can differ from state and configuration; terraform surfaces reconciliation actions during planning; this behavior should be assessed against the concrete need to retain references needed to reconcile previously created resources and plan how to protect, back up, and restore state deliberately. The second measure is intended to make one authoritative state accessible to a collaborating team: Remote backends centralize state storage and may offer locking; sharing a state file via Git is not an equivalent concurrency or secret-management solution; this behavior should be assessed against the concrete need to retain references needed to reconcile previously created resources and plan how to protect, back up, and restore state deliberately. Neither is the directly designated method for the separate goals of retain references needed to reconcile previously created resources and plan how to protect, back up, and restore state deliberately in this review.