Question 1080
A diagnostic incident during Terraform execution has a concrete implementation goal: supply the remote identifier in the format accepted by the resource's provider. What is the most appropriate Terraform mechanism?
- terraform import ADDRESS ID
- terraform plan -generate-config-out
- Separate resources for separate imports
- An import block's id argument
Explanation
Correct Answer
D:Provider documentation determines the required import identity; it may be an ID or compound identifier depending on resource type; this directly meets the requirement to supply the remote identifier in the format accepted by the resource's provider. By comparison, separate resources for separate imports is intended to avoid attaching two remote objects to the same Terraform resource address, which is a different task from supply the remote identifier in the format accepted by the resource's provider.
Incorrect Answers
A:The import CLI command records a provider-defined remote ID at a Terraform address but does not automatically write a complete resource block; this mechanism is useful when the job is to associate one existing remote object with a configured resource address, whereas the current scenario requires the engineer to supply the remote identifier in the format accepted by the resource's provider. These operations have different effects in the stated Terraform workflow.
B:The experimental config-generation flag can write suggested resource declarations for review and correction before apply; this mechanism is useful when the job is to produce draft HCL for resources named in import blocks without matching configuration, whereas the current scenario requires the engineer to supply the remote identifier in the format accepted by the resource's provider. These operations have different effects in the stated Terraform workflow.
C:Each managed remote object should have its own appropriate resource instance address so state can map objects unambiguously; this mechanism is useful when the job is to avoid attaching two remote objects to the same Terraform resource address, whereas the current scenario requires the engineer to supply the remote identifier in the format accepted by the resource's provider. These operations have different effects in the stated Terraform workflow.
Question 1081
A Terraform operations troubleshooting session requires a way to review whether Terraform intends to change imported infrastructure unexpectedly. Which Terraform approach most directly fulfills that request?
- The import block
- A matching resource declaration
- A post-import plan
- Provider permissions during import
Explanation
Correct Answer
C:After import, planning reveals mismatches between the declared resource arguments and the discovered remote object's attributes; this directly meets the requirement to review whether Terraform intends to change imported infrastructure unexpectedly. By comparison, provider permissions during import is intended to read an existing cloud object so Terraform can associate it with state, which is a different task from review whether Terraform intends to change imported infrastructure unexpectedly.
Incorrect Answers
A:A top-level import block identifies a target resource address and import identity so the operation participates in plan and apply; this mechanism is useful when the job is to declare a managed import operation in configuration for planning and applying, whereas the current scenario requires the engineer to review whether Terraform intends to change imported infrastructure unexpectedly. These operations have different effects in the stated Terraform workflow.
B:Imported infrastructure should have a corresponding resource block with configuration matching the desired attributes so the next plan is safe; this mechanism is useful when the job is to avoid unintended changes immediately after importing a remote object, whereas the current scenario requires the engineer to review whether Terraform intends to change imported infrastructure unexpectedly. These operations have different effects in the stated Terraform workflow.
D:Import needs correct provider authentication and sufficient access to query the target resource using its provider-defined import ID; this mechanism is useful when the job is to read an existing cloud object so Terraform can associate it with state, whereas the current scenario requires the engineer to review whether Terraform intends to change imported infrastructure unexpectedly. These operations have different effects in the stated Terraform workflow.
Question 1082
An engineer proposes “Provider version compatibility” to read current attributes of managed remote objects during planning. Which outcome does the proposed technique actually provide?
- Providers implement resource and data-source schemas plus read, create, update and delete operations for their services.
- Terraform checks downloaded provider package checksums against lock information where hashes are available.
- Providers retrieve object details so Terraform can compare observed infrastructure against desired configuration and prior state.
- Version constraints and a shared lock file reduce unintended schema and behavior changes between deployments.
Explanation
Correct Answer
D:Provider version compatibility is used when an operator needs to prevent incompatible provider upgrades from affecting resource handling. Consequently, this choice cannot meet the separate requirement to read current attributes of managed remote objects during planning. The intended action would instead require Provider data refresh.
Incorrect Answers
A:This behavior belongs to A provider plugin, which helps engineers translate Terraform resource operations into calls to the relevant remote API rather than satisfying the separate requirement to read current attributes of managed remote objects during planning. The attempted technique was Provider version compatibility; it would instead be used to prevent incompatible provider upgrades from affecting resource handling, not to produce the effect associated with A provider plugin.
B:This behavior belongs to Provider integrity hashes, which helps engineers detect a mismatched plugin distribution package rather than satisfying the separate requirement to read current attributes of managed remote objects during planning. The attempted technique was Provider version compatibility; it would instead be used to prevent incompatible provider upgrades from affecting resource handling, not to produce the effect associated with Provider integrity hashes.
C:That outcome belongs to Provider data refresh, the mechanism that can read current attributes of managed remote objects during planning. The question concerns the engineer’s actual proposal, Provider version compatibility; it is directed at prevent incompatible provider upgrades from affecting resource handling, not that result.
Question 1083
An engineer intends to select the first expression that evaluates without a dynamic error and is reviewing “The try function”. What consequence follows from using it as intended?
- concat joins lists end to end and preserves their element ordering, including duplicate values.
- flatten recursively replaces nested lists with their constituent elements, while preserving ordered traversal.
- try evaluates expressions in order and returns the first successful result, rather than simply the first non-null value.
- dynamic constructs blocks required by resource schemas; it does not create standalone Terraform resource declarations.
Explanation
Correct Answer
C:The named mechanism is used when the objective is to select the first expression that evaluates without a dynamic error, so it produces the behavior described. In contrast, the concat function serves a different goal: append the elements of multiple lists into one sequence, not select the first expression that evaluates without a dynamic error.
Incorrect Answers
A:The description applies to the concat function when an engineer needs to append the elements of multiple lists into one sequence; the named the try function instead handles the requirement to select the first expression that evaluates without a dynamic error, so this behavior does not describe The try function in the situation named.
B:The description applies to the flatten function when an engineer needs to remove nested list layers to obtain a flat sequence; the named the try function instead handles the requirement to select the first expression that evaluates without a dynamic error, so this behavior does not describe The try function in the situation named.
D:The description applies to the dynamic block when an engineer needs to generate repeated nested blocks from a collection; the named the try function instead handles the requirement to select the first expression that evaluates without a dynamic error, so this behavior does not describe The try function in the situation named.
Question 1084
Reviewers reject “No implicit child-module alias inheritance” as a way to reuse a provider whose source address differs from its short local identifier. Which actual behavior explains why the proposal is unsuitable?
- 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.
- A data block can set provider = aws.secondary to query through an alternate provider configuration.
- Non-default provider configurations must be passed explicitly to a child module instead of assuming aliases will propagate.
Explanation
Correct Answer
D:No implicit child-module alias inheritance is used when an operator needs to prevent a child module from silently using an unpassed alternate provider configuration. Consequently, this choice cannot meet the separate requirement to reuse a provider whose source address differs from its short local identifier. The intended action would instead require Provider-local name mapping.
Incorrect Answers
A:That outcome belongs to Provider-local name mapping, the mechanism that can reuse a provider whose source address differs from its short local identifier. The question concerns the engineer’s actual proposal, No implicit child-module alias inheritance; it is directed at prevent a child module from silently using an unpassed alternate provider configuration, not that result.
B:This behavior belongs to A default provider configuration, which helps engineers make resources use a common account without an explicit provider argument rather than satisfying the separate requirement to reuse a provider whose source address differs from its short local identifier. The attempted technique was No implicit child-module alias inheritance; it would instead be used to prevent a child module from silently using an unpassed alternate provider configuration, not to produce the effect associated with A default provider configuration.
C:This behavior belongs to Explicit provider selection on data blocks, which helps engineers read an object from a secondary account rather than the default account rather than satisfying the separate requirement to reuse a provider whose source address differs from its short local identifier. The attempted technique was No implicit child-module alias inheritance; it would instead be used to prevent a child module from silently using an unpassed alternate provider configuration, not to produce the effect associated with Explicit provider selection on data blocks.
Question 1085
An organization integrating Terraform with source control needs to monitor whether infrastructure-specific check assertions still pass after deployment. Which feature or operation is the most direct match?
- HCP continuous validation
- A restricted private registry
- Workspace run approvals
- Organization variable sets
Explanation
Correct Answer
A:Continuous validation can evaluate configuration check blocks to identify operational health issues in supported workspaces; this directly meets the requirement to monitor whether infrastructure-specific check assertions still pass after deployment. By comparison, a restricted private registry is intended to let approved teams discover modules while controlling publication rights, which is a different task from monitor whether infrastructure-specific check assertions still pass after deployment.
Incorrect Answers
B:Registry access and publishing permissions help centralize reusable module governance across teams; this mechanism is useful when the job is to let approved teams discover modules while controlling publication rights, whereas the current scenario requires the engineer to monitor whether infrastructure-specific check assertions still pass after deployment. These operations have different effects in the stated Terraform workflow.
C:HCP Terraform approval workflow separates viewing a plan from the permission to proceed with an apply; this mechanism is useful when the job is to require an authorized person to approve a run before applying changes, whereas the current scenario requires the engineer to monitor whether infrastructure-specific check assertions still pass after deployment. These operations have different effects in the stated Terraform workflow.
D:Variable sets let administrators manage common workspace variables centrally and scope them to intended workspaces or projects; this mechanism is useful when the job is to supply shared environment or Terraform input values across several workspaces, whereas the current scenario requires the engineer to monitor whether infrastructure-specific check assertions still pass after deployment. These operations have different effects in the stated Terraform workflow.
Question 1086
During one infrastructure delivery, the team must satisfy all of the following: (1) modify and re-plan after a change request is rejected; (2) catch a resource block lacking a mandatory argument. Select TWO appropriate Terraform approaches. Choose TWO.
- Iterate after feedback
- Review a plan before apply
- Validate after init
- Separate plan and apply privileges
- Missing required argument detection
Explanation
Correct Answers
A:A revised configuration must be planned again because a prior plan does not automatically incorporate later edits; this meets the requirement to modify and re-plan after a change request is rejected, while the other selected techniques address catch a resource block lacking a mandatory argument, which require their own distinct Terraform mechanisms.
E:Validation compares configuration with provider schemas and reports missing required fields; this meets the requirement to catch a resource block lacking a mandatory argument, while the other selected techniques address modify and re-plan after a change request is rejected, which require their own distinct Terraform mechanisms.
Incorrect Answers
B:The plan stage compares desired configuration with observed resource state and shows the proposed operations for review; it addresses inspect predicted create, update and delete actions prior to making changes, but this delivery instead requires modify and re-plan after a change request is rejected and catch a resource block lacking a mandatory argument. The required combination involves Iterate after feedback and Missing required argument detection, not the behavior of Review a plan before apply.
C:Because validate consults provider and module definitions, run init first to install referenced dependencies; it addresses resolve missing provider schemas before checking configuration, but this delivery instead requires modify and re-plan after a change request is rejected and catch a resource block lacking a mandatory argument. The required combination involves Iterate after feedback and Missing required argument detection, not the behavior of Validate after init.
D:Teams can make planning a review step and reserve apply execution for an authorized operator or HCP Terraform run; it addresses require approval before an infrastructure change executes, but this delivery instead requires modify and re-plan after a change request is rejected and catch a resource block lacking a mandatory argument. The required combination involves Iterate after feedback and Missing required argument detection, not the behavior of Separate plan and apply privileges.
Question 1087
A runbook lists “A module root directory” for the task to understand which source files Terraform loads as one module. Which technical effect should its description include?
- All Terraform configuration files in a module directory are combined as one module; filenames do not define separate execution units.
- The providers map on the module call maps child provider names to selected provider configurations from the root module.
- Parent configurations can pass one child module's outputs into another child's inputs to compose larger infrastructure systems.
- The for_each meta-argument instantiates keyed module instances addressable as module.NAME["key"].
Explanation
Correct Answer
A:The named mechanism is used when the objective is to understand which source files Terraform loads as one module, so it produces the behavior described. In contrast, a module with for_each serves a different goal: create one child module instance for each stable application key, not understand which source files Terraform loads as one module.
Incorrect Answers
B:The description applies to module provider mappings when an engineer needs to send the correct region-specific provider into a reusable child module; the named a module root directory instead handles the requirement to understand which source files Terraform loads as one module, so this behavior does not describe A module root directory in the situation named.
C:The description applies to module composition when an engineer needs to combine small modules into a root configuration without producing one giant module; the named a module root directory instead handles the requirement to understand which source files Terraform loads as one module, so this behavior does not describe A module root directory in the situation named.
D:The description applies to a module with for_each when an engineer needs to create one child module instance for each stable application key; the named a module root directory instead handles the requirement to understand which source files Terraform loads as one module, so this behavior does not describe A module root directory in the situation named.
Question 1088
A platform team separating infrastructure deployments requires a way to review past runs and changes in a shared HCP organization. Which Terraform approach most directly fulfills that request?
- Workspace audit history
- The HCP private module registry
- HCP provider dynamic credentials
- A restricted private registry
Explanation
Correct Answer
A:Run history records plan and apply activity to support team review and change tracking; this directly meets the requirement to review past runs and changes in a shared HCP organization. By comparison, the HCP private module registry is intended to share approved modules with organization members without relying on public registry visibility, which is a different task from review past runs and changes in a shared HCP organization.
Incorrect Answers
B:Private registry modules can be published, versioned and discovered by authorized HCP Terraform users; this mechanism is useful when the job is to share approved modules with organization members without relying on public registry visibility, whereas the current scenario requires the engineer to review past runs and changes in a shared HCP organization. These operations have different effects in the stated Terraform workflow.
C:HCP Terraform can use supported dynamic provider credentials that are generated for runs rather than stored as permanent workspace secrets; this mechanism is useful when the job is to replace standing cloud keys with short-lived run identities, whereas the current scenario requires the engineer to review past runs and changes in a shared HCP organization. These operations have different effects in the stated Terraform workflow.
D:Registry access and publishing permissions help centralize reusable module governance across teams; this mechanism is useful when the job is to let approved teams discover modules while controlling publication rights, whereas the current scenario requires the engineer to review past runs and changes in a shared HCP organization. These operations have different effects in the stated Terraform workflow.
Question 1089
An engineering checklist calls for separate outcomes: (1) identify how the local backend stores nondefault workspaces; (2) avoid multiple infrastructure applies targeting the same shared HCP workspace state; (3) change the address of a tracked object directly within state. Which THREE options implement the requested outcomes? Choose THREE.
- terraform state mv
- HCP Terraform run serialization
- A normal plan with drift
- Local workspace state directories
- State migration from local storage
- terraform plan -lock-timeout
Explanation
Correct Answers
A:The state mv command reassigns a managed resource's address without contacting the provider to destroy the object; this meets the requirement to change the address of a tracked object directly within state, while the other selected techniques address identify how the local backend stores nondefault workspaces and avoid multiple infrastructure applies targeting the same shared HCP workspace state, which require their own distinct Terraform mechanisms.
B:HCP Terraform coordinates workspace runs and state handling, reducing conflicts among collaborating operators; this meets the requirement to avoid multiple infrastructure applies targeting the same shared HCP workspace state, while the other selected techniques address identify how the local backend stores nondefault workspaces and change the address of a tracked object directly within state, which require their own distinct Terraform mechanisms.
D:When local workspaces are used, nondefault state snapshots are placed under a terraform.tfstate.d directory structure; this meets the requirement to identify how the local backend stores nondefault workspaces, while the other selected techniques address avoid multiple infrastructure applies targeting the same shared HCP workspace state and change the address of a tracked object directly within state, which require their own distinct Terraform mechanisms.
Incorrect Answers
C:Providers refresh remote resource attributes, and planning can propose updates to bring changed objects back to declared configuration; it addresses detect and propose correction for changes made outside Terraform, but this delivery instead requires identify how the local backend stores nondefault workspaces and avoid multiple infrastructure applies targeting the same shared HCP workspace state and change the address of a tracked object directly within state. The required combination involves Local workspace state directories and HCP Terraform run serialization and terraform state mv, not the behavior of A normal plan with drift.
E:Changing the root backend and running init -migrate-state can transfer the existing snapshot to the newly configured destination; it addresses move an established project to remote state without abandoning resource identity, but this delivery instead requires identify how the local backend stores nondefault workspaces and avoid multiple infrastructure applies targeting the same shared HCP workspace state and change the address of a tracked object directly within state. The required combination involves Local workspace state directories and HCP Terraform run serialization and terraform state mv, not the behavior of State migration from local storage.
F:The lock-timeout option lets Terraform retry lock acquisition for a specified duration before returning an error; it addresses wait for a temporary state lock instead of failing immediately, but this delivery instead requires identify how the local backend stores nondefault workspaces and avoid multiple infrastructure applies targeting the same shared HCP workspace state and change the address of a tracked object directly within state. The required combination involves Local workspace state directories and HCP Terraform run serialization and terraform state mv, not the behavior of terraform plan -lock-timeout.
Question 1090
An engineer intends to extract a primitive output without the surrounding formatted representation and is reviewing “terraform output -raw”. What consequence follows from using it as intended?
- The -raw output mode prints a single string, number or boolean value in a script-friendly form and may reveal sensitive data.
- Terraform reads variables named TF_VAR_name as a source of input assignments, subject to input precedence rules.
- Command-line -var assignments take high precedence and are useful for an explicit run-specific override.
- The module block assigns arguments corresponding to input variables declared in the child; variables are scoped to modules.
Explanation
Correct Answer
A:The named mechanism is used when the objective is to extract a primitive output without the surrounding formatted representation, so it produces the behavior described. In contrast, the -var option serves a different goal: supply a single variable assignment when invoking plan or apply, not extract a primitive output without the surrounding formatted representation.
Incorrect Answers
B:The description applies to an environment variable prefixed TF_VAR_ when an engineer needs to provide root-module input values from an automated execution environment; the named terraform output -raw instead handles the requirement to extract a primitive output without the surrounding formatted representation, so this behavior does not describe terraform output -raw in the situation named.
C:The description applies to the -var option when an engineer needs to supply a single variable assignment when invoking plan or apply; the named terraform output -raw instead handles the requirement to extract a primitive output without the surrounding formatted representation, so this behavior does not describe terraform output -raw in the situation named.
D:The description applies to passing module inputs explicitly when an engineer needs to configure a child module with parent-provided values; the named terraform output -raw instead handles the requirement to extract a primitive output without the surrounding formatted representation, so this behavior does not describe terraform output -raw in the situation named.