Question 380
A team proposes “A default provider configuration” to pass an aliased provider configuration into a child module. If they proceed with that technique, which result should they anticipate instead?
- List both plugins under required_providers and configure each service's provider independently as needed.
- The required_providers entry maps the chosen local name to a specific fully qualified provider source address.
- An unaliased provider block configures the default instance used by matching resources that do not override provider selection.
- The module call's providers argument maps the child's expected provider configuration name to a provider configuration available in the parent.
Explanation
Correct Answer
C:A default provider configuration is used when an operator needs to make resources use a common account without an explicit provider argument. Consequently, this choice cannot meet the separate requirement to pass an aliased provider configuration into a child module. The intended action would instead require The providers map on a module call.
Incorrect Answers
A:This behavior belongs to Separate required provider names, which helps engineers use two unrelated service APIs in one root configuration rather than satisfying the separate requirement to pass an aliased provider configuration into a child module. The attempted technique was A default provider configuration; it would instead be used to make resources use a common account without an explicit provider argument, not to produce the effect associated with Separate required provider names.
B:This behavior belongs to Provider-local name mapping, which helps engineers reuse a provider whose source address differs from its short local identifier rather than satisfying the separate requirement to pass an aliased provider configuration into a child module. The attempted technique was A default provider configuration; it would instead be used to make resources use a common account without an explicit provider argument, not to produce the effect associated with Provider-local name mapping.
D:That outcome belongs to The providers map on a module call, the mechanism that can pass an aliased provider configuration into a child module. The question concerns the engineer’s actual proposal, A default provider configuration; it is directed at make resources use a common account without an explicit provider argument, not that result.
Question 381
A change request asks an engineer to tie an approved infrastructure change to a reviewed commit. Which choice best implements the requested behavior?
- Review a plan before apply
- Iterate after feedback
- Keep configuration in version control
- Write configuration first
- Initialize after checkout
Explanation
Correct Answer
C:Committing root module files allows the team to relate plans and runs to a specific version of intended infrastructure; this directly meets the requirement to tie an approved infrastructure change to a reviewed commit. By comparison, iterate after feedback is intended to modify and re-plan after a change request is rejected, which is a different task from tie an approved infrastructure change to a reviewed commit.
Incorrect Answers
A:The plan stage compares desired configuration with observed resource state and shows the proposed operations for review; this concerns the task to inspect predicted create, update and delete actions prior to making changes, not the current need to tie an approved infrastructure change to a reviewed commit. A Keep configuration in version control approach is appropriate here; the substituted Review a plan before apply option does not supply the specified Terraform capability.
B:A revised configuration must be planned again because a prior plan does not automatically incorporate later edits; this mechanism is useful when the job is to modify and re-plan after a change request is rejected, whereas the current scenario requires the engineer to tie an approved infrastructure change to a reviewed commit. These operations have different effects in the stated Terraform workflow.
D:The workflow begins by declaring resources, inputs and dependencies that describe what Terraform should manage; this mechanism is useful when the job is to express the intended infrastructure before asking Terraform for a plan, whereas the current scenario requires the engineer to tie an approved infrastructure change to a reviewed commit. These operations have different effects in the stated Terraform workflow.
E:Running terraform init configures backend access, child modules and required providers before plans can run; this concerns the task to prepare a newly cloned root module for local Terraform operations, not the current need to tie an approved infrastructure change to a reviewed commit. A Keep configuration in version control approach is appropriate here; the substituted Initialize after checkout option does not supply the specified Terraform capability.
Question 382
During a design review, the requirement is to identify an in-place change rather than object recreation. Which option should the engineer select?
- terraform plan -target
- terraform plan -refresh-only
- terraform graph
- A resource action marked tilde
Explanation
Correct Answer
D:In human-readable plan diffs, ~ indicates that Terraform proposes updating existing resource attributes; this directly meets the requirement to identify an in-place change rather than object recreation. By comparison, terraform graph is intended to display configuration and state dependencies for troubleshooting, which is a different task from identify an in-place change rather than object recreation.
Incorrect Answers
A:Targeting narrows planning scope and can miss other required changes, so it is not the normal long-term workflow; this mechanism is useful when the job is to limit a recovery-oriented plan to a resource and its dependencies, whereas the current scenario requires the engineer to identify an in-place change rather than object recreation. These operations have different effects in the stated Terraform workflow.
B:Refresh-only planning proposes changes to Terraform state or root outputs based on remote observations, without proposing ordinary resource updates; this mechanism is useful when the job is to propose updating state or root outputs to reflect remote changes without planning infrastructure remediation, whereas the current scenario requires the engineer to identify an in-place change rather than object recreation. These operations have different effects in the stated Terraform workflow.
C:The graph command emits a DOT graph representation of Terraform dependencies, useful for spotting unexpected ordering constraints; this mechanism is useful when the job is to display configuration and state dependencies for troubleshooting, whereas the current scenario requires the engineer to identify an in-place change rather than object recreation. These operations have different effects in the stated Terraform workflow.
Question 383
A Terraform reviewer encounters “configuration_aliases in required_providers” while assessing how to declare which alternate provider configurations a child module is allowed to receive. Which statement correctly describes its actual behavior?
- The required_providers entry maps the chosen local name to a specific fully qualified provider source address.
- List both plugins under required_providers and configure each service's provider independently as needed.
- A data block can set provider = aws.secondary to query through an alternate provider configuration.
- A child module's required_providers entry uses configuration_aliases to advertise provider aliases referenced inside the module.
Explanation
Correct Answer
D:The named mechanism is used when the objective is to declare which alternate provider configurations a child module is allowed to receive, so it produces the behavior described. In contrast, provider configuration at the root serves a different goal: supply provider configurations from the root module to reusable child modules, not declare which alternate provider configurations a child module is allowed to receive.
Incorrect Answers
A:The description applies to provider-local name mapping when an engineer needs to reuse a provider whose source address differs from its short local identifier; the named configuration_aliases in required_providers instead handles the requirement to declare which alternate provider configurations a child module is allowed to receive, so this behavior does not describe configuration_aliases in required_providers in the situation named.
B:This describes Separate required provider names and its job to use two unrelated service APIs in one root configuration, whereas the question asks about configuration_aliases in required_providers. The latter is the mechanism used to declare which alternate provider configurations a child module is allowed to receive; the proposed effect belongs to a different Terraform feature.
C: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 configuration_aliases in required_providers instead handles the requirement to declare which alternate provider configurations a child module is allowed to receive, so this behavior does not describe configuration_aliases in required_providers in the situation named.
Question 384
A team compares Terraform mechanisms for the goal to reproduce previously selected provider package versions on other machines. Which stated consequence belongs specifically to “The dependency lock file”?
- The pessimistic constraint ~> 5.3.0 admits versions at least 5.3.0 but below 5.4.0.
- The pessimistic constraint ~> 5.3 permits version 5.3 and later releases below 6.0.0.
- The terraform block's required_version expression constrains which Terraform executable can operate on the configuration.
- The .terraform.lock.hcl file records selected provider versions and checksums to constrain subsequent installations.
Explanation
Correct Answer
D:The named mechanism is used when the objective is to reproduce previously selected provider package versions on other machines, so it produces the behavior described. In contrast, the required_version setting serves a different goal: restrict the Terraform CLI version rather than a provider plugin, not reproduce previously selected provider package versions on other machines.
Incorrect Answers
A:The description applies to a compatible provider constraint when an engineer needs to accept patch updates within a chosen minor line; the named the dependency lock file instead handles the requirement to reproduce previously selected provider package versions on other machines, so this behavior does not describe The dependency lock file in the situation named.
B:The description applies to a major-series compatible constraint when an engineer needs to accept minor and patch updates without crossing the next major version; the named the dependency lock file instead handles the requirement to reproduce previously selected provider package versions on other machines, so this behavior does not describe The dependency lock file in the situation named.
C:The description applies to the required_version setting when an engineer needs to restrict the Terraform CLI version rather than a provider plugin; the named the dependency lock file instead handles the requirement to reproduce previously selected provider package versions on other machines, so this behavior does not describe The dependency lock file in the situation named.
Question 385
A Terraform change proposal names “The -var-file option” to load a nonstandard variable file selected for one environment. Which outcome can reviewers attribute to that particular mechanism?
- The JSON output mode serializes output values and metadata for automation; it can expose sensitive values and must be protected.
- The -var-file flag explicitly selects a variables file rather than relying on auto-loaded naming conventions.
- Marking an output sensitive redacts ordinary CLI presentation, but does not by itself prevent storage in state.
- Validation uses a condition expression and error_message to provide a tailored error when the supplied input is unacceptable.
- A variable block without a default requires a provided value if Terraform cannot otherwise obtain one.
- A variable's type constraint enforces the intended structure and allows appropriate Terraform type conversions.
Explanation
Correct Answer
B:The named mechanism is used when the objective is to load a nonstandard variable file selected for one environment, so it produces the behavior described. In contrast, a sensitive output serves a different goal: hide a secret-like output from Terraform's usual human-readable display, not load a nonstandard variable file selected for one environment.
Incorrect Answers
A:The description applies to terraform output -json when an engineer needs to retrieve root outputs for integration with another program; the named the -var-file option instead handles the requirement to load a nonstandard variable file selected for one environment, so this behavior does not describe The -var-file option in the situation named.
C:The description applies to a sensitive output when an engineer needs to hide a secret-like output from Terraform's usual human-readable display; the named the -var-file option instead handles the requirement to load a nonstandard variable file selected for one environment, so this behavior does not describe The -var-file option in the situation named.
D:The description applies to a variable validation block when an engineer needs to reject an input value that violates an explicit business rule; the named the -var-file option instead handles the requirement to load a nonstandard variable file selected for one environment, so this behavior does not describe The -var-file option in the situation named.
E:The description applies to a required input variable when an engineer needs to ask the caller for a value when no default should be assumed; the named the -var-file option instead handles the requirement to load a nonstandard variable file selected for one environment, so this behavior does not describe The -var-file option in the situation named.
F:The description applies to the variable type argument when an engineer needs to reject caller values that cannot satisfy the declared input type; the named the -var-file option instead handles the requirement to load a nonstandard variable file selected for one environment, so this behavior does not describe The -var-file option in the situation named.
Question 386
A change request asks an engineer to normalize a string identifier to lowercase. Which choice best implements the requested behavior?
- The for expression
- The lower function
- The coalescelist function
- The dynamic block
- The lookup function
Explanation
Correct Answer
B:lower converts letters to lowercase and is often used in consistent name expressions; this directly meets the requirement to normalize a string identifier to lowercase. By comparison, the for expression is intended to transform a collection's elements into a new list or map, which is a different task from normalize a string identifier to lowercase.
Incorrect Answers
A:A for expression builds derived collection values, optionally filtering with an if clause and transforming keys or values; this mechanism is useful when the job is to transform a collection's elements into a new list or map, whereas the current scenario requires the engineer to normalize a string identifier to lowercase. These operations have different effects in the stated Terraform workflow.
C:coalescelist evaluates list arguments and returns the first with at least one element; this mechanism is useful when the job is to choose the first nonempty list from several candidates, whereas the current scenario requires the engineer to normalize a string identifier to lowercase. These operations have different effects in the stated Terraform workflow.
D:dynamic constructs blocks required by resource schemas; it does not create standalone Terraform resource declarations; this mechanism is useful when the job is to generate repeated nested blocks from a collection, whereas the current scenario requires the engineer to normalize a string identifier to lowercase. These operations have different effects in the stated Terraform workflow.
E:lookup(map, key, default) retrieves the selected key's value or the supplied default if the key does not exist; this mechanism is useful when the job is to read a map element and provide a fallback when the key is absent, whereas the current scenario requires the engineer to normalize a string identifier to lowercase. These operations have different effects in the stated Terraform workflow.
Question 387
A change request asks an engineer to remove the managed infrastructure described by the current Terraform configuration. Which choice best implements the requested behavior?
- terraform destroy
- Dependency-aware deletion
- terraform apply -destroy
- An explicit prevent_destroy rule
Explanation
Correct Answer
A:The destroy command plans and applies removal of managed objects subject to lifecycle and provider constraints; this directly meets the requirement to remove the managed infrastructure described by the current Terraform configuration. By comparison, terraform apply -destroy is intended to execute a destroy-mode apply within a controlled workflow, which is a different task from remove the managed infrastructure described by the current Terraform configuration.
Incorrect Answers
B:Terraform generally reverses dependency order when destroying managed resources so dependent objects are removed first; this mechanism is useful when the job is to remove dependent resources before objects they rely on, whereas the current scenario requires the engineer to remove the managed infrastructure described by the current Terraform configuration. These operations have different effects in the stated Terraform workflow.
C:The destroy mode tells apply to plan removal of managed resources rather than ordinary convergence to resource declarations; this mechanism is useful when the job is to execute a destroy-mode apply within a controlled workflow, whereas the current scenario requires the engineer to remove the managed infrastructure described by the current Terraform configuration. These operations have different effects in the stated Terraform workflow.
D:The lifecycle prevent_destroy setting rejects a plan that destroys or replaces a configured resource while the rule remains present; this mechanism is useful when the job is to block a destructive plan for a protected configured resource, whereas the current scenario requires the engineer to remove the managed infrastructure described by the current Terraform configuration. These operations have different effects in the stated Terraform workflow.
Question 388
Reviewers reject “terraform apply -parallelism” as a way to inspect state and re-plan when a provider operation fails partway through. Which actual behavior explains why the proposal is unsuitable?
- The -var option supplies a named input for the execution; it does not edit the variable declaration in code.
- The parallelism setting controls Terraform's concurrent resource operation count, which can mitigate API throttling.
- A partial apply may have changed some resources, so Terraform should refresh and build a new plan rather than blindly assuming a full rollback.
- The -input=false option prevents prompts for missing input, requiring all necessary values and approvals to be handled by automation.
Explanation
Correct Answer
B:terraform apply -parallelism is used when an operator needs to limit how many graph operations execute concurrently. Consequently, this choice cannot meet the separate requirement to inspect state and re-plan when a provider operation fails partway through. The intended action would instead require Apply failure recovery.
Incorrect Answers
A:This behavior belongs to Apply with -var, which helps engineers override a declared root-module input value for a particular run rather than satisfying the separate requirement to inspect state and re-plan when a provider operation fails partway through. The attempted technique was terraform apply -parallelism; it would instead be used to limit how many graph operations execute concurrently, not to produce the effect associated with Apply with -var.
C:That outcome belongs to Apply failure recovery, the mechanism that can inspect state and re-plan when a provider operation fails partway through. The question concerns the engineer’s actual proposal, terraform apply -parallelism; it is directed at limit how many graph operations execute concurrently, not that result.
D:This behavior belongs to Noninteractive apply settings, which helps engineers run Terraform in automation where prompting is not acceptable rather than satisfying the separate requirement to inspect state and re-plan when a provider operation fails partway through. The attempted technique was terraform apply -parallelism; it would instead be used to limit how many graph operations execute concurrently, not to produce the effect associated with Noninteractive apply settings.
Question 389
A Terraform change proposal names “The concat function” to append the elements of multiple lists into one sequence. Which outcome can reviewers attribute to that particular mechanism?
- concat joins lists end to end and preserves their element ordering, including duplicate values.
- keys returns a lexicographically sorted list of map keys, useful for deterministic iteration.
- upper transforms the letters of a string into uppercase without changing its underlying Terraform type.
- The condition ? value_a : value_b expression chooses a suitable branch without creating duplicate resource blocks.
Explanation
Correct Answer
A:The named mechanism is used when the objective is to append the elements of multiple lists into one sequence, so it produces the behavior described. In contrast, the keys function serves a different goal: list the names of keys defined in a map, not append the elements of multiple lists into one sequence.
Incorrect Answers
B:The description applies to the keys function when an engineer needs to list the names of keys defined in a map; the named the concat function instead handles the requirement to append the elements of multiple lists into one sequence, so this behavior does not describe The concat function in the situation named.
C:The description applies to the upper function when an engineer needs to convert an environment label to uppercase; the named the concat function instead handles the requirement to append the elements of multiple lists into one sequence, so this behavior does not describe The concat function in the situation named.
D:The description applies to the ternary conditional operator when an engineer needs to set a resource argument according to a boolean expression; the named the concat function instead handles the requirement to append the elements of multiple lists into one sequence, so this behavior does not describe The concat function in the situation named.
Question 390
Reviewers reject “State resource addresses” as a way to prevent staging changes from unintentionally sharing the production state mapping. Which actual behavior explains why the proposal is unsuitable?
- Distinct backends, workspaces or root configurations can isolate state, but the configuration must target the intended instance set.
- A backend with state-locking support obtains a lock during operations that can modify state, avoiding conflicting simultaneous writes.
- State maps Terraform instance addresses to remote object identifiers and remembered attributes for subsequent comparisons.
- State may contain secret values even when CLI output is redacted, so storage encryption and access controls matter.
Explanation
Correct Answer
C:State resource addresses is used when an operator needs to identify which remote object corresponds to a particular configuration resource. Consequently, this choice cannot meet the separate requirement to prevent staging changes from unintentionally sharing the production state mapping. The intended action would instead require Separate state per environment.
Incorrect Answers
A:That outcome belongs to Separate state per environment, the mechanism that can prevent staging changes from unintentionally sharing the production state mapping. The question concerns the engineer’s actual proposal, State resource addresses; it is directed at identify which remote object corresponds to a particular configuration resource, not that result.
B:This behavior belongs to State locking, which helps engineers prevent concurrent state writers from overwriting each other's updates rather than satisfying the separate requirement to prevent staging changes from unintentionally sharing the production state mapping. The attempted technique was State resource addresses; it would instead be used to identify which remote object corresponds to a particular configuration resource, not to produce the effect associated with State locking.
D:This behavior belongs to State access protection, which helps engineers treat a Terraform state file as potentially sensitive data rather than satisfying the separate requirement to prevent staging changes from unintentionally sharing the production state mapping. The attempted technique was State resource addresses; it would instead be used to identify which remote object corresponds to a particular configuration resource, not to produce the effect associated with State access protection.