Question 780
A change request asks an engineer to force an update when a write-only secret changes without exposing the secret itself. Which choice best implements the requested behavior?
- Environment-based provider credentials
- Not treating Base64 as secrecy
- Vault short-lived credentials
- A write-only argument version field
Explanation
Correct Answer
D:Some write-only provider arguments expose an accompanying nonsecret version marker that triggers a new operation when incremented; this directly meets the requirement to force an update when a write-only secret changes without exposing the secret itself. By comparison, not treating Base64 as secrecy is intended to recognize that an encoded password remains sensitive information, which is a different task from force an update when a write-only secret changes without exposing the secret itself.
Incorrect Answers
A:Providers can often authenticate through environment variables or identity integrations so credentials are absent from checked-in HCL; this mechanism is useful when the job is to avoid putting provider access tokens directly in configuration source, whereas the current scenario requires the engineer to force an update when a write-only secret changes without exposing the secret itself. These operations have different effects in the stated Terraform workflow.
B:Base64 is reversible encoding; exposing encoded credentials in configuration or state still risks disclosure; this mechanism is useful when the job is to recognize that an encoded password remains sensitive information, whereas the current scenario requires the engineer to force an update when a write-only secret changes without exposing the secret itself. These operations have different effects in the stated Terraform workflow.
C:Vault's dynamic credentials can provide expiring access with centrally enforced policies instead of permanent embedded keys; this mechanism is useful when the job is to limit the lifetime and scope of identities used by infrastructure automation, whereas the current scenario requires the engineer to force an update when a write-only secret changes without exposing the secret itself. These operations have different effects in the stated Terraform workflow.
Question 781
A change request asks an engineer to run declarative module tests instead of only checking syntax. Which choice best implements the requested behavior?
- Validate without live deployment
- terraform test
- terraform validate
- A type mismatch diagnosis
- Validate after init
Explanation
Correct Answer
B:The Terraform test command executes defined test runs and assertions, which can exercise behavior beyond basic configuration validation; this directly meets the requirement to run declarative module tests instead of only checking syntax. By comparison, terraform validate is intended to check that Terraform configuration is structurally valid without planning resource changes, which is a different task from run declarative module tests instead of only checking syntax.
Incorrect Answers
A:terraform validate runs offline-oriented configuration checks and does not deploy managed resources; this mechanism is useful when the job is to detect invalid configuration even when no cloud changes should occur, whereas the current scenario requires the engineer to run declarative module tests instead of only checking syntax. These operations have different effects in the stated Terraform workflow.
C:The validate command checks syntax and schema consistency in an initialized configuration without obtaining a full execution plan; this mechanism is useful when the job is to check that Terraform configuration is structurally valid without planning resource changes, whereas the current scenario requires the engineer to run declarative module tests instead of only checking syntax. These operations have different effects in the stated Terraform workflow.
D:Provider schemas and Terraform's type checking can make validate fail before an apply is attempted; this mechanism is useful when the job is to catch an argument whose expression does not match the provider schema, whereas the current scenario requires the engineer to run declarative module tests instead of only checking syntax. These operations have different effects in the stated Terraform workflow.
E:Because validate consults provider and module definitions, run init first to install referenced dependencies; this mechanism is useful when the job is to resolve missing provider schemas before checking configuration, whereas the current scenario requires the engineer to run declarative module tests instead of only checking syntax. These operations have different effects in the stated Terraform workflow.
Question 782
Reviewers reject “State access protection” as a way to maintain dependencies for resources that have been removed from configuration. Which actual behavior explains why the proposal is unsuitable?
- A normal plan attempts to refresh state from providers before comparing objects to the current configuration.
- State can retain dependency information needed to correctly destroy objects no longer declared in configuration.
- State may contain secret values even when CLI output is redacted, so storage encryption and access controls matter.
- State maps Terraform instance addresses to remote object identifiers and remembered attributes for subsequent comparisons.
Explanation
Correct Answer
C:State access protection is used when an operator needs to treat a Terraform state file as potentially sensitive data. Consequently, this choice cannot meet the separate requirement to maintain dependencies for resources that have been removed from configuration. The intended action would instead require State-backed dependency links.
Incorrect Answers
A:This behavior belongs to Terraform refresh during planning, which helps engineers detect actual resource attributes rather than relying only on historical saved values rather than satisfying the separate requirement to maintain dependencies for resources that have been removed from configuration. The attempted technique was State access protection; it would instead be used to treat a Terraform state file as potentially sensitive data, not to produce the effect associated with Terraform refresh during planning.
B:That outcome belongs to State-backed dependency links, the mechanism that can maintain dependencies for resources that have been removed from configuration. The question concerns the engineer’s actual proposal, State access protection; it is directed at treat a Terraform state file as potentially sensitive data, not that result.
D:This behavior belongs to State resource addresses, which helps engineers identify which remote object corresponds to a particular configuration resource rather than satisfying the separate requirement to maintain dependencies for resources that have been removed from configuration. The attempted technique was State access protection; it would instead be used to treat a Terraform state file as potentially sensitive data, not to produce the effect associated with State resource addresses.
Question 783
During a design review, the requirement is to format Terraform files in nested directories under a module tree. Which option should the engineer select?
- terraform fmt -recursive
- terraform fmt
- terraform fmt -check
- Formatting versus validation
Explanation
Correct Answer
A:The recursive switch extends formatting into subdirectories rather than limiting the operation to the current directory; this directly meets the requirement to format Terraform files in nested directories under a module tree. By comparison, terraform fmt -check is intended to make a CI formatting gate detect source files that need formatting, which is a different task from format Terraform files in nested directories under a module tree.
Incorrect Answers
B:The fmt command rewrites HCL source according to Terraform's formatting conventions without provisioning resources; this mechanism is useful when the job is to apply Terraform's canonical formatting to local .tf source files, whereas the current scenario requires the engineer to format Terraform files in nested directories under a module tree. These operations have different effects in the stated Terraform workflow.
C:Check mode verifies formatting and returns a failure when changes would be required instead of writing edited files; this mechanism is useful when the job is to make a CI formatting gate detect source files that need formatting, whereas the current scenario requires the engineer to format Terraform files in nested directories under a module tree. These operations have different effects in the stated Terraform workflow.
D:terraform fmt addresses canonical HCL layout while terraform validate checks whether the configuration is structurally acceptable; this mechanism is useful when the job is to distinguish style-only issues from Terraform type and schema errors, whereas the current scenario requires the engineer to format Terraform files in nested directories under a module tree. These operations have different effects in the stated Terraform workflow.
Question 784
During an infrastructure design review about how to protect a workstation's local state file even when output values are hidden, a maintainer asks what “State file confidentiality” does. Which description is accurate?
- A temporary runner may lose its filesystem after a job, so durable shared state is usually needed for repeatable team automation.
- Terraform commonly writes backup snapshots for local state updates, but backups require the same confidentiality controls as state.
- Local state can hold raw provider attributes and secrets, so filesystem access controls and encryption matter.
- Changing the root backend and running init -migrate-state can transfer the existing snapshot to the newly configured destination.
Explanation
Correct Answer
C:The named mechanism is used when the objective is to protect a workstation's local state file even when output values are hidden, so it produces the behavior described. In contrast, local state in CI serves a different goal: recognize why ephemeral build agents should not rely on a machine-local state file, not protect a workstation's local state file even when output values are hidden.
Incorrect Answers
A:The description applies to local state in CI when an engineer needs to recognize why ephemeral build agents should not rely on a machine-local state file; the named state file confidentiality instead handles the requirement to protect a workstation's local state file even when output values are hidden, so this behavior does not describe State file confidentiality in the situation named.
B:The description applies to a local state backup file when an engineer needs to recover from a state change without relying solely on an unversioned primary file; the named state file confidentiality instead handles the requirement to protect a workstation's local state file even when output values are hidden, so this behavior does not describe State file confidentiality in the situation named.
D:The description applies to state migration from local storage when an engineer needs to move an established project to remote state without abandoning resource identity; the named state file confidentiality instead handles the requirement to protect a workstation's local state file even when output values are hidden, so this behavior does not describe State file confidentiality in the situation named.
Question 785
An engineer intends to download missing required provider plugins before planning and is reviewing “terraform init”. What consequence follows from using it as intended?
- Initialization resolves provider requirements, installs plugins, and prepares modules and backend settings in the working directory.
- The terraform block's required_version expression constrains which Terraform executable can operate on the configuration.
- The providers lock subcommand updates dependency lock information, including hashes for specified target operating-system platforms.
- A version requirement such as >= 5.0.0 allows matching later versions but does not cap major-version upgrades.
Explanation
Correct Answer
A:The named mechanism is used when the objective is to download missing required provider plugins before planning, 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 download missing required provider plugins before planning.
Incorrect Answers
B: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 terraform init instead handles the requirement to download missing required provider plugins before planning, so this behavior does not describe terraform init in the situation named.
C:The description applies to terraform providers lock when an engineer needs to populate provider package checksums for selected platforms; the named terraform init instead handles the requirement to download missing required provider plugins before planning, so this behavior does not describe terraform init in the situation named.
D:The description applies to a lower-bound provider constraint when an engineer needs to allow provider releases no older than a tested minimum; the named terraform init instead handles the requirement to download missing required provider plugins before planning, so this behavior does not describe terraform init in the situation named.
Question 786
A change request asks an engineer to pass an aliased provider configuration into a child module. Which choice best implements the requested behavior?
- A default provider configuration
- The providers map on a module call
- A resource's provider meta-argument
- Provider-local name mapping
- Separate required provider names
- Explicit provider selection on data blocks
Explanation
Correct Answer
B:The module call's providers argument maps the child's expected provider configuration name to a provider configuration available in the parent; this directly meets the requirement to pass an aliased provider configuration into a child module. By comparison, provider configuration at the root is intended to supply provider configurations from the root module to reusable child modules, which is a different task from pass an aliased provider configuration into a child module.
Incorrect Answers
A:An unaliased provider block configures the default instance used by matching resources that do not override provider selection; this mechanism is useful when the job is to make resources use a common account without an explicit provider argument, whereas the current scenario requires the engineer to pass an aliased provider configuration into a child module. These operations have different effects in the stated Terraform workflow.
C:The resource-level provider meta-argument selects a provider instance, not a different backend or Terraform workspace; this mechanism is useful when the job is to route a particular managed object to the named alternate provider configuration, whereas the current scenario requires the engineer to pass an aliased provider configuration into a child module. These operations have different effects in the stated Terraform workflow.
D:The required_providers entry maps the chosen local name to a specific fully qualified provider source address; this concerns the task to reuse a provider whose source address differs from its short local identifier, not the current need to pass an aliased provider configuration into a child module. A The providers map on a module call approach is appropriate here; the substituted Provider-local name mapping option does not supply the specified Terraform capability.
E:List both plugins under required_providers and configure each service's provider independently as needed; this mechanism is useful when the job is to use two unrelated service APIs in one root configuration, whereas the current scenario requires the engineer to pass an aliased provider configuration into a child module. These operations have different effects in the stated Terraform workflow.
F:A data block can set provider = aws.secondary to query through an alternate provider configuration; this mechanism is useful when the job is to read an object from a secondary account rather than the default account, whereas the current scenario requires the engineer to pass an aliased provider configuration into a child module. These operations have different effects in the stated Terraform workflow.
Question 787
An output block uses the value expression split(",", "a,b,c"). Assuming only the literal data shown, which result should be expected?
- "abc"
- ["a", "b", "c"] (three-element list)
- ["a", "b,c"]
- ["a,b,c"] (single-element list)
Explanation
Correct Answer
B:The expression split(",", "a,b,c") evaluates to ["a", "b", "c"] because split divides the input string at each comma and returns a three-element list. This is Terraform's direct evaluation of the supplied literal arguments in split(",", "a,b,c"), not an external provider lookup.
Incorrect Answers
A:Removing delimiters without creating list elements is not how split works. For split(",", "a,b,c"), split divides the input string at each comma and returns a three-element list; consequently this candidate is not the value Terraform computes.
C:The second comma must be processed as well as the first one. HCL evaluates split(",", "a,b,c") using the supplied arguments: split divides the input string at each comma and returns a three-element list; the listed result is therefore incorrect.
D:This would leave the comma-delimited input as one element rather than splitting it. In this specific evaluation, split divides the input string at each comma and returns a three-element list, which rules out the proposed alternative.
Question 788
A Terraform deployment has independent requirements: (1) specify which resource instance address should receive the imported object; (2) focus verbose diagnostics on Terraform Core rather than all plugin activity. Which TWO mechanisms directly address these needs? Choose TWO.
- TF_LOG_CORE
- An import block's to argument
- A matching resource declaration
- terraform plan -generate-config-out
- TF_LOG_PROVIDER
- A post-import plan
Explanation
Correct Answers
A:The TF_LOG_CORE variable can control log verbosity for Core messages independently of general logging; this meets the requirement to focus verbose diagnostics on Terraform Core rather than all plugin activity, while the other selected techniques address specify which resource instance address should receive the imported object, which require their own distinct Terraform mechanisms.
B:The to argument points to an intended Terraform resource address rather than a provider account name or state backend; this meets the requirement to specify which resource instance address should receive the imported object, while the other selected techniques address focus verbose diagnostics on Terraform Core rather than all plugin activity, which require their own distinct Terraform mechanisms.
Incorrect Answers
C:Imported infrastructure should have a corresponding resource block with configuration matching the desired attributes so the next plan is safe; it addresses avoid unintended changes immediately after importing a remote object, but this delivery instead requires specify which resource instance address should receive the imported object and focus verbose diagnostics on Terraform Core rather than all plugin activity. The required combination involves An import block's to argument and TF_LOG_CORE, not the behavior of A matching resource declaration.
D:The experimental config-generation flag can write suggested resource declarations for review and correction before apply; it addresses produce draft HCL for resources named in import blocks without matching configuration, but this delivery instead requires specify which resource instance address should receive the imported object and focus verbose diagnostics on Terraform Core rather than all plugin activity. The required combination involves An import block's to argument and TF_LOG_CORE, not the behavior of terraform plan -generate-config-out.
E:The TF_LOG_PROVIDER setting controls provider log verbosity and can help locate failures involving provider communication; it addresses isolate provider-related diagnostic output during API troubleshooting, but this delivery instead requires specify which resource instance address should receive the imported object and focus verbose diagnostics on Terraform Core rather than all plugin activity. The required combination involves An import block's to argument and TF_LOG_CORE, not the behavior of TF_LOG_PROVIDER.
F:After import, planning reveals mismatches between the declared resource arguments and the discovered remote object's attributes; it addresses review whether Terraform intends to change imported infrastructure unexpectedly, but this delivery instead requires specify which resource instance address should receive the imported object and focus verbose diagnostics on Terraform Core rather than all plugin activity. The required combination involves An import block's to argument and TF_LOG_CORE, not the behavior of A post-import plan.
Question 789
An engineering checklist calls for separate outcomes: (1) recognize why ephemeral build agents should not rely on a machine-local state file; (2) serialize operations that write the same Terraform state. Which TWO options implement the requested outcomes? Choose TWO.
- Backend-specific lock support
- Local state in CI
- State consistency during CI
- The local backend's lack of team collaboration features
- A backend state lock
Explanation
Correct Answers
B:A temporary runner may lose its filesystem after a job, so durable shared state is usually needed for repeatable team automation; this meets the requirement to recognize why ephemeral build agents should not rely on a machine-local state file, while the other selected techniques address serialize operations that write the same Terraform state, which require their own distinct Terraform mechanisms.
E:Supported backends acquire a state lock so simultaneous writers cannot corrupt or overwrite each other's state changes; this meets the requirement to serialize operations that write the same Terraform state, while the other selected techniques address recognize why ephemeral build agents should not rely on a machine-local state file, which require their own distinct Terraform mechanisms.
Incorrect Answers
A:Backend state locking behavior depends on the backend implementation; remote storage alone does not guarantee safe locking; it addresses check whether a chosen remote backend actually offers state locking, but this delivery instead requires recognize why ephemeral build agents should not rely on a machine-local state file and serialize operations that write the same Terraform state. The required combination involves Local state in CI and A backend state lock, not the behavior of Backend-specific lock support.
C:A state backend with locking helps serialize competing changes, complemented by pipeline approval and run coordination; it addresses keep two pipelines from changing the same infrastructure state simultaneously, but this delivery instead requires recognize why ephemeral build agents should not rely on a machine-local state file and serialize operations that write the same Terraform state. The required combination involves Local state in CI and A backend state lock, not the behavior of State consistency during CI.
D:Local files do not provide an organization-wide shared state or distributed locking comparable to an appropriately configured remote backend; it addresses avoid concurrent writes from multiple operators on different machines, but this delivery instead requires recognize why ephemeral build agents should not rely on a machine-local state file and serialize operations that write the same Terraform state. The required combination involves Local state in CI and A backend state lock, not the behavior of The local backend's lack of team collaboration features.
Question 790
A Terraform runbook prescribes “TF_LOG_CORE” to save enabled Terraform diagnostic logs to a designated file, but it does not meet the requirement. What does that step actually accomplish?
- High verbosity creates large logs and greater secret-exposure risk; enable it for a specific incident and disable it afterward.
- Unsetting or disabling Terraform's TF_LOG environment setting removes extra diagnostic verbosity from later commands.
- TF_LOG_PATH directs log output to a file and should be combined with an enabled TF_LOG level.
- The TF_LOG_CORE variable can control log verbosity for Core messages independently of general logging.
Explanation
Correct Answer
D:TF_LOG_CORE is used when an operator needs to focus verbose diagnostics on Terraform Core rather than all plugin activity. Consequently, this choice cannot meet the separate requirement to save enabled Terraform diagnostic logs to a designated file. The intended action would instead require TF_LOG_PATH.
Incorrect Answers
A:This behavior belongs to Verbose logging only during diagnosis, which helps engineers avoid permanent trace logs in normal automated runs rather than satisfying the separate requirement to save enabled Terraform diagnostic logs to a designated file. The attempted technique was TF_LOG_CORE; it would instead be used to focus verbose diagnostics on Terraform Core rather than all plugin activity, not to produce the effect associated with Verbose logging only during diagnosis.
B:This behavior belongs to Disabling TF_LOG, which helps engineers return a shell session to ordinary Terraform logging after investigation rather than satisfying the separate requirement to save enabled Terraform diagnostic logs to a designated file. The attempted technique was TF_LOG_CORE; it would instead be used to focus verbose diagnostics on Terraform Core rather than all plugin activity, not to produce the effect associated with Disabling TF_LOG.
C:That outcome belongs to TF_LOG_PATH, the mechanism that can save enabled Terraform diagnostic logs to a designated file. The question concerns the engineer’s actual proposal, TF_LOG_CORE; it is directed at focus verbose diagnostics on Terraform Core rather than all plugin activity, not that result.