Question 80
A Terraform reviewer encounters “State locking” while assessing how to prevent concurrent state writers from overwriting each other's updates. Which statement correctly describes its actual behavior?
- Distinct backends, workspaces or root configurations can isolate state, but the configuration must target the intended instance set.
- Reading a remote state output still requires access to the underlying snapshot; exporting data through a narrower interface can reduce exposure.
- State metadata includes lineage and serial information that helps Terraform identify state history and updates.
- 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.
- A backend with state-locking support obtains a lock during operations that can modify state, avoiding conflicting simultaneous writes.
Explanation
Correct Answer
F:The named mechanism is used when the objective is to prevent concurrent state writers from overwriting each other's updates, so it produces the behavior described. In contrast, state resource addresses serves a different goal: identify which remote object corresponds to a particular configuration resource, not prevent concurrent state writers from overwriting each other's updates.
Incorrect Answers
A:The description applies to separate state per environment when an engineer needs to prevent staging changes from unintentionally sharing the production state mapping; the named state locking instead handles the requirement to prevent concurrent state writers from overwriting each other's updates, so this behavior does not describe State locking in the situation named.
B:The description applies to remote state sharing boundaries when an engineer needs to avoid exposing full state when another stack only needs a published identifier; the named state locking instead handles the requirement to prevent concurrent state writers from overwriting each other's updates, so this behavior does not describe State locking in the situation named.
C:The description applies to the state serial number when an engineer needs to understand how successive snapshots are ordered; the named state locking instead handles the requirement to prevent concurrent state writers from overwriting each other's updates, so this behavior does not describe State locking in the situation named.
D:The description applies to state resource addresses when an engineer needs to identify which remote object corresponds to a particular configuration resource; the named state locking instead handles the requirement to prevent concurrent state writers from overwriting each other's updates, so this behavior does not describe State locking in the situation named.
E:The description applies to state access protection when an engineer needs to treat a Terraform state file as potentially sensitive data; the named state locking instead handles the requirement to prevent concurrent state writers from overwriting each other's updates, so this behavior does not describe State locking in the situation named.
Question 81
During an infrastructure design review about how to define which configuration branch or directory produces automatic runs, a maintainer asks what “A workspace's VCS repository settings” does. Which description is accurate?
- Variable sets can be scoped to projects to share configuration while avoiding repetitive per-workspace assignments.
- Projects organize workspaces by application, team or environment, simplifying scope and access administration.
- Workspace settings store variables for that workspace's execution; global sets should not replace environment-specific data blindly.
- VCS connection details identify the source code changes that should trigger a workspace's Terraform run.
- A project is a grouping and access construct; changing project assignment does not turn two workspaces into one state.
- A run trigger can initiate a downstream plan when its designated upstream workspace completes the relevant run.
Explanation
Correct Answer
D:The named mechanism is used when the objective is to define which configuration branch or directory produces automatic runs, so it produces the behavior described. In contrast, HCP Terraform run triggers between workspaces serves a different goal: coordinate a dependent app deployment following an upstream network workspace apply, not define which configuration branch or directory produces automatic runs.
Incorrect Answers
A:The description applies to project-level variable sets when an engineer needs to assign common environment values to a group of workspaces; the named a workspace's VCS repository settings instead handles the requirement to define which configuration branch or directory produces automatic runs, so this behavior does not describe A workspace's VCS repository settings in the situation named.
B:The description applies to an HCP Terraform project when an engineer needs to group related workspaces under one organizational and permissions boundary; the named a workspace's VCS repository settings instead handles the requirement to define which configuration branch or directory produces automatic runs, so this behavior does not describe A workspace's VCS repository settings in the situation named.
C:The description applies to workspace-specific variables when an engineer needs to override or tailor values used by one particular stack; the named a workspace's VCS repository settings instead handles the requirement to define which configuration branch or directory produces automatic runs, so this behavior does not describe A workspace's VCS repository settings in the situation named.
E:The description applies to project membership changes when an engineer needs to move a workspace to a different organizational group without merging infrastructure state; the named a workspace's VCS repository settings instead handles the requirement to define which configuration branch or directory produces automatic runs, so this behavior does not describe A workspace's VCS repository settings in the situation named.
F:The description applies to HCP Terraform run triggers between workspaces when an engineer needs to coordinate a dependent app deployment following an upstream network workspace apply; the named a workspace's VCS repository settings instead handles the requirement to define which configuration branch or directory produces automatic runs, so this behavior does not describe A workspace's VCS repository settings in the situation named.
Question 82
A build job for a Terraform configuration requires a way to determine which identity actually performs infrastructure changes. Which Terraform approach most directly fulfills that request?
- Post-apply outputs
- Apply using current credentials
- terraform apply -auto-approve
- Apply a saved plan
Explanation
Correct Answer
B:Provider API operations use the provider's configured credentials or supported ambient authentication, not the login name in a commit; this directly meets the requirement to determine which identity actually performs infrastructure changes. By comparison, post-apply outputs is intended to retrieve computed identifiers that can be used by deployment automation, which is a different task from determine which identity actually performs infrastructure changes.
Incorrect Answers
A:Root output blocks expose values Terraform calculates from the applied resource graph; output display is not an access-control boundary; this mechanism is useful when the job is to retrieve computed identifiers that can be used by deployment automation, whereas the current scenario requires the engineer to determine which identity actually performs infrastructure changes. These operations have different effects in the stated Terraform workflow.
C:The auto-approve option allows the automatically created plan to proceed without interactive confirmation, so pipeline safeguards matter; this mechanism is useful when the job is to suppress Terraform's normal approval prompt in a controlled pipeline, whereas the current scenario requires the engineer to determine which identity actually performs infrastructure changes. These operations have different effects in the stated Terraform workflow.
D:Passing the saved plan file to terraform apply uses its recorded choices; applying a plan file does not start a new interactive replanning step; this mechanism is useful when the job is to execute exactly the plan artifact that was reviewed, whereas the current scenario requires the engineer to determine which identity actually performs infrastructure changes. These operations have different effects in the stated Terraform workflow.
Question 83
A team compares Terraform mechanisms for the goal to connect two modules by declared output and input values. Which stated consequence belongs specifically to “A module dependency interface”?
- Module outputs provide explicit integration points between modules without relying on child resource addresses.
- The module block's version argument can constrain registry modules and is separate from Terraform CLI and provider version settings.
- An output-to-input reference establishes a natural dependency and avoids imposing broad depends_on edges unnecessarily.
- The for_each meta-argument instantiates keyed module instances addressable as module.NAME["key"].
Explanation
Correct Answer
C:The named mechanism is used when the objective is to connect two modules by declared output and input values, so it produces the behavior described. In contrast, a module output reference serves a different goal: use a network module's subnet IDs inside an application module call, not connect two modules by declared output and input values.
Incorrect Answers
A:The description applies to a module output reference when an engineer needs to use a network module's subnet IDs inside an application module call; the named a module dependency interface instead handles the requirement to connect two modules by declared output and input values, so this behavior does not describe A module dependency interface in the situation named.
B:The description applies to using a module registry version when an engineer needs to control which published module release a root configuration consumes; the named a module dependency interface instead handles the requirement to connect two modules by declared output and input values, so this behavior does not describe A module dependency interface 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 dependency interface instead handles the requirement to connect two modules by declared output and input values, so this behavior does not describe A module dependency interface in the situation named.
Question 84
A Terraform deployment has independent requirements: (1) detect and propose correction for changes made outside Terraform; (2) avoid embedding cloud backend access keys into tracked Terraform source. Which TWO mechanisms directly address these needs? Choose TWO.
- Remote state encryption at rest
- A normal plan with drift
- Backend state key separation
- A data source instead of import
- ignore_changes for shared ownership
- Backend credentials from the environment
Explanation
Correct Answers
B:Providers refresh remote resource attributes, and planning can propose updates to bring changed objects back to declared configuration; this meets the requirement to detect and propose correction for changes made outside Terraform, while the other selected techniques address avoid embedding cloud backend access keys into tracked Terraform source, which require their own distinct Terraform mechanisms.
F:Supported backends can discover authentication from environment settings or identity mechanisms rather than inline key literals; this meets the requirement to avoid embedding cloud backend access keys into tracked Terraform source, while the other selected techniques address detect and propose correction for changes made outside Terraform, which require their own distinct Terraform mechanisms.
Incorrect Answers
A:Encryption is controlled by the chosen backend service; Terraform's remote backend abstraction does not supply one universal encryption mechanism; it addresses protect stored state contents from unauthorized storage-layer access, but this delivery instead requires detect and propose correction for changes made outside Terraform and avoid embedding cloud backend access keys into tracked Terraform source. The required combination involves Backend credentials from the environment and A normal plan with drift, not the behavior of Remote state encryption at rest.
C:Using distinct backend keys or workspaces creates separate state namespaces instead of letting unrelated root configurations share one snapshot; it addresses store different applications' state snapshots at distinct object paths, but this delivery instead requires detect and propose correction for changes made outside Terraform and avoid embedding cloud backend access keys into tracked Terraform source. The required combination involves Backend credentials from the environment and A normal plan with drift, not the behavior of Backend state key separation.
D:A data block can read an external object's attributes while avoiding taking over its create-update-delete lifecycle; it addresses refer to shared infrastructure that another stack owns without changing its lifecycle, but this delivery instead requires detect and propose correction for changes made outside Terraform and avoid embedding cloud backend access keys into tracked Terraform source. The required combination involves Backend credentials from the environment and A normal plan with drift, not the behavior of A data source instead of import.
E:The lifecycle ignore_changes rule suppresses post-creation update plans for selected attributes while leaving other attributes managed; it addresses stop Terraform from overwriting a field delegated to an external controller, but this delivery instead requires detect and propose correction for changes made outside Terraform and avoid embedding cloud backend access keys into tracked Terraform source. The required combination involves Backend credentials from the environment and A normal plan with drift, not the behavior of ignore_changes for shared ownership.
Question 85
A Terraform deployment has independent requirements: (1) recognize why ephemeral build agents should not rely on a machine-local state file; (2) wait for a temporary state lock instead of failing immediately. Which TWO mechanisms directly address these needs? Choose TWO.
- A local backend path setting
- A backend state lock
- terraform plan -lock-timeout
- Lock ownership verification
- State migration from local storage
- Local state in CI
Explanation
Correct Answers
C:The lock-timeout option lets Terraform retry lock acquisition for a specified duration before returning an error; this meets the requirement to wait for a temporary state lock instead of failing immediately, 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.
F: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 wait for a temporary state lock instead of failing immediately, which require their own distinct Terraform mechanisms.
Incorrect Answers
A:The local backend supports a path argument for where the state file is stored on disk; it addresses save the default workspace state to a nondefault local filename, but this delivery instead requires recognize why ephemeral build agents should not rely on a machine-local state file and wait for a temporary state lock instead of failing immediately. The required combination involves Local state in CI and terraform plan -lock-timeout, not the behavior of A local backend path setting.
B:Supported backends acquire a state lock so simultaneous writers cannot corrupt or overwrite each other's state changes; it addresses serialize operations that write the same Terraform state, but this delivery instead requires recognize why ephemeral build agents should not rely on a machine-local state file and wait for a temporary state lock instead of failing immediately. The required combination involves Local state in CI and terraform plan -lock-timeout, not the behavior of A backend state lock.
D:A lock may belong to another active run, so check its identity and run status rather than immediately forcing removal; it addresses confirm that a held lock is stale before attempting manual removal, but this delivery instead requires recognize why ephemeral build agents should not rely on a machine-local state file and wait for a temporary state lock instead of failing immediately. The required combination involves Local state in CI and terraform plan -lock-timeout, not the behavior of Lock ownership verification.
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 recognize why ephemeral build agents should not rely on a machine-local state file and wait for a temporary state lock instead of failing immediately. The required combination involves Local state in CI and terraform plan -lock-timeout, not the behavior of State migration from local storage.
Question 86
Reviewers reject “Provider configuration inheritance” as a way to limit ordinary display of a sensitive result exported from a reusable module. Which actual behavior explains why the proposal is unsuitable?
- A child output can be marked sensitive, but its underlying value may still reside in state unless it uses permitted ephemeral handling.
- Default provider configurations can be inherited, while alternate aliases need explicit mapping and declared configuration aliases.
- Each call has its own variable assignments and resource instances, even when both calls reference the same module source directory.
- A child module may validate its input variables using conditions and errors independent of the parent's variable definitions.
Explanation
Correct Answer
B:Provider configuration inheritance is used when an operator needs to understand which provider settings a child module can use from its parent. Consequently, this choice cannot meet the separate requirement to limit ordinary display of a sensitive result exported from a reusable module. The intended action would instead require Child module outputs and sensitivity.
Incorrect Answers
A:That outcome belongs to Child module outputs and sensitivity, the mechanism that can limit ordinary display of a sensitive result exported from a reusable module. The question concerns the engineer’s actual proposal, Provider configuration inheritance; it is directed at understand which provider settings a child module can use from its parent, not that result.
C:This behavior belongs to Different values for two module calls, which helps engineers instantiate the same module with distinct environment inputs rather than satisfying the separate requirement to limit ordinary display of a sensitive result exported from a reusable module. The attempted technique was Provider configuration inheritance; it would instead be used to understand which provider settings a child module can use from its parent, not to produce the effect associated with Different values for two module calls.
D:This behavior belongs to Variable validation inside a module, which helps engineers enforce a reusable module's own input contract rather than satisfying the separate requirement to limit ordinary display of a sensitive result exported from a reusable module. The attempted technique was Provider configuration inheritance; it would instead be used to understand which provider settings a child module can use from its parent, not to produce the effect associated with Variable validation inside a module.
Question 87
During a design review, the requirement is to distinguish no changes from proposed changes in automation. Which option should the engineer select?
- terraform graph
- A replacement action in the plan
- The dependency graph during planning
- terraform plan -detailed-exitcode
- A resource action marked plus
Explanation
Correct Answer
D:Detailed exit codes are 0 for no diff, 2 for a nonempty successful plan and 1 for an error; this directly meets the requirement to distinguish no changes from proposed changes in automation. By comparison, a replacement action in the plan is intended to recognize a destroy-and-create operation for an immutable argument, which is a different task from distinguish no changes from proposed changes in automation.
Incorrect Answers
A: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 distinguish no changes from proposed changes in automation. These operations have different effects in the stated Terraform workflow.
B:Plans show replacement when the provider cannot update a changed property in place; create-before-destroy can change the replacement order; this mechanism is useful when the job is to recognize a destroy-and-create operation for an immutable argument, whereas the current scenario requires the engineer to distinguish no changes from proposed changes in automation. These operations have different effects in the stated Terraform workflow.
C:Terraform graph nodes can run concurrently when no dependency edge requires a particular order; this mechanism is useful when the job is to explain why two unrelated resources can be planned and applied in parallel, whereas the current scenario requires the engineer to distinguish no changes from proposed changes in automation. These operations have different effects in the stated Terraform workflow.
E:In conventional human-readable plans, + signifies that a managed resource is proposed for creation; this mechanism is useful when the job is to interpret the leading + symbol in Terraform's plan, whereas the current scenario requires the engineer to distinguish no changes from proposed changes in automation. These operations have different effects in the stated Terraform workflow.
Question 88
During a design review, the requirement is to detect that a state snapshot belongs to a different history or older generation. Which option should the engineer select?
- A refreshed missing resource
- A moved block
- terraform state rm
- ignore_changes for shared ownership
- Serial and lineage checks
Explanation
Correct Answer
E:State metadata such as lineage and serial helps protect against incompatible or stale state updates; this directly meets the requirement to detect that a state snapshot belongs to a different history or older generation. By comparison, terraform state rm is intended to forget a managed object without destroying the corresponding real infrastructure, which is a different task from detect that a state snapshot belongs to a different history or older generation.
Incorrect Answers
A:If a provider reports a tracked object no longer exists, a normal plan generally proposes recreating it when its resource block remains; this mechanism is useful when the job is to understand why Terraform proposes creating a managed object deleted outside the workflow, whereas the current scenario requires the engineer to detect that a state snapshot belongs to a different history or older generation. These operations have different effects in the stated Terraform workflow.
B:A moved block maps an old Terraform address to a new one so state follows the refactor rather than planning destruction and creation; this mechanism is useful when the job is to rename or relocate a managed resource address without recreating the remote object, whereas the current scenario requires the engineer to detect that a state snapshot belongs to a different history or older generation. These operations have different effects in the stated Terraform workflow.
C:The state rm command removes the association so the remote object remains but is no longer tracked by that state; this mechanism is useful when the job is to forget a managed object without destroying the corresponding real infrastructure, whereas the current scenario requires the engineer to detect that a state snapshot belongs to a different history or older generation. These operations have different effects in the stated Terraform workflow.
D:The lifecycle ignore_changes rule suppresses post-creation update plans for selected attributes while leaving other attributes managed; this mechanism is useful when the job is to stop Terraform from overwriting a field delegated to an external controller, whereas the current scenario requires the engineer to detect that a state snapshot belongs to a different history or older generation. These operations have different effects in the stated Terraform workflow.
Question 89
A team compares Terraform mechanisms for the goal to wait for a temporary state lock instead of failing immediately. Which stated consequence belongs specifically to “terraform plan -lock-timeout”?
- Terraform obtains and releases supported backend locks around state-sensitive operations; a crash can sometimes leave manual recovery necessary.
- A state backend with locking helps serialize competing changes, complemented by pipeline approval and run coordination.
- Terraform uses lock information to distinguish a specific operation's lock from unrelated lock holders.
- The lock-timeout option lets Terraform retry lock acquisition for a specified duration before returning an error.
- A lock may belong to another active run, so check its identity and run status rather than immediately forcing removal.
Explanation
Correct Answer
D:The named mechanism is used when the objective is to wait for a temporary state lock instead of failing immediately, so it produces the behavior described. In contrast, lock ownership verification serves a different goal: confirm that a held lock is stale before attempting manual removal, not wait for a temporary state lock instead of failing immediately.
Incorrect Answers
A:The description applies to lock release after completion when an engineer needs to understand why a normal Terraform operation frees the lock; the named terraform plan -lock-timeout instead handles the requirement to wait for a temporary state lock instead of failing immediately, so this behavior does not describe terraform plan -lock-timeout in the situation named.
B:The description applies to state consistency during CI when an engineer needs to keep two pipelines from changing the same infrastructure state simultaneously; the named terraform plan -lock-timeout instead handles the requirement to wait for a temporary state lock instead of failing immediately, so this behavior does not describe terraform plan -lock-timeout in the situation named.
C:The description applies to a lock identifier when an engineer needs to ensure a force-unlock targets the correct held state lock; the named terraform plan -lock-timeout instead handles the requirement to wait for a temporary state lock instead of failing immediately, so this behavior does not describe terraform plan -lock-timeout in the situation named.
E:The description applies to lock ownership verification when an engineer needs to confirm that a held lock is stale before attempting manual removal; the named terraform plan -lock-timeout instead handles the requirement to wait for a temporary state lock instead of failing immediately, so this behavior does not describe terraform plan -lock-timeout in the situation named.
Question 90
An engineering checklist calls for separate outcomes: (1) make a CI formatting gate detect source files that need formatting; (2) tie an approved infrastructure change to a reviewed commit. Which TWO options implement the requested outcomes? Choose TWO.
- Formatting versus validation
- terraform fmt -diff
- terraform fmt -check
- Keep configuration in version control
- Review a plan before apply
- Write configuration first
Explanation
Correct Answers
C:Check mode verifies formatting and returns a failure when changes would be required instead of writing edited files; this meets the requirement to make a CI formatting gate detect source files that need formatting, while the other selected techniques address tie an approved infrastructure change to a reviewed commit, which require their own distinct Terraform mechanisms.
D:Committing root module files allows the team to relate plans and runs to a specific version of intended infrastructure; this meets the requirement to tie an approved infrastructure change to a reviewed commit, while the other selected techniques address make a CI formatting gate detect source files that need formatting, which require their own distinct Terraform mechanisms.
Incorrect Answers
A:terraform fmt addresses canonical HCL layout while terraform validate checks whether the configuration is structurally acceptable; it addresses distinguish style-only issues from Terraform type and schema errors, but this delivery instead requires make a CI formatting gate detect source files that need formatting and tie an approved infrastructure change to a reviewed commit. The required combination involves Keep configuration in version control and terraform fmt -check, not the behavior of Formatting versus validation.
B:The diff switch displays textual differences between current file formatting and the canonical formatting result; it addresses show which HCL formatting edits Terraform would make, but this delivery instead requires make a CI formatting gate detect source files that need formatting and tie an approved infrastructure change to a reviewed commit. The required combination involves Keep configuration in version control and terraform fmt -check, not the behavior of terraform fmt -diff.
E: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 and the independent requirement to make a CI formatting gate detect source files that need formatting. 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 and the independent requirement to make a CI formatting gate detect source files that need formatting.
F:The workflow begins by declaring resources, inputs and dependencies that describe what Terraform should manage; it addresses express the intended infrastructure before asking Terraform for a plan, but this delivery instead requires make a CI formatting gate detect source files that need formatting and tie an approved infrastructure change to a reviewed commit. The required combination involves Keep configuration in version control and terraform fmt -check, not the behavior of Write configuration first.