Question 1000
A Terraform operator is specifically tasked to choose an ephemeral or write-only route when a credential must not persist. Which mechanism most directly meets this particular need?
- Sensitive variable flag
- Secret rotation and state boundary
- Provider write-only argument
- Ephemeral input variable
Explanation
Correct Answer
B:The task is to choose an ephemeral or write-only route when a credential must not persist; Secret rotation and state boundary directly supports that requirement: Terraform's ephemeral support and provider write-only arguments can avoid persisting supported temporary values. Its relevant boundary is: Ordinary resource arguments marked sensitive can still end up in state.
Incorrect Answers
A:Sensitive variable flag is designed to redact secret values from normal Terraform CLI displays, whereas this task is to choose an ephemeral or write-only route when a credential must not persist: sensitive=true marks an input as sensitive and propagates that sensitivity into derived expressions. Against Secret rotation and state boundary, its limitation is: The underlying value can still be stored in state and plan artifacts.
C:Provider write-only argument is designed to send a secret to a supporting resource without retaining it in Terraform state, whereas this task is to choose an ephemeral or write-only route when a credential must not persist: A write-only provider argument consumes a value during apply without persisting the argument in state or plan. Against Secret rotation and state boundary, its limitation is: Provider schema support and Terraform 1.11 or later are required.
D:Ephemeral input variable is designed to use a temporary credential without persisting its value into state or plan, whereas this task is to choose an ephemeral or write-only route when a credential must not persist: ephemeral=true on a variable keeps its value available during the operation but omits it from state and plan files. Against Secret rotation and state boundary, its limitation is: Such a value can be referenced only in allowed ephemeral contexts.
Question 1001
A team reviews the use of Destroy scope and workspace selection in Terraform 1.12. Which purpose matches its actual behavior?
- limit a destructive operation to a selected object only when necessary
- keep confirmation and review around irreversible resource deletion
- avoid deleting another environment by checking the active state context
- stop managing a resource while keeping its real object intact
Explanation
Correct Answer
C:The practical result of Destroy scope and workspace selection, used to avoid deleting another environment by checking the active state context, is: Destroy affects managed resources bound to the selected workspace or backend state. A qualification for this effect is: Identical Terraform files can manage different objects when their states differ.
Incorrect Answers
A:That outcome applies to Targeted destruction caution, intended to limit a destructive operation to a selected object only when necessary, rather than the question's feature Destroy scope and workspace selection: terraform destroy -target=ADDRESS restricts action scope for exceptional situations. Unlike Targeted destruction caution, Destroy scope and workspace selection is intended to avoid deleting another environment by checking the active state context, not to limit a destructive operation to a selected object only when necessary.
B:That outcome applies to Destroy approval safeguards, intended to keep confirmation and review around irreversible resource deletion, rather than the question's feature Destroy scope and workspace selection: An interactive destroy presents planned removal before approval unless automation bypasses it. Unlike Destroy approval safeguards, Destroy scope and workspace selection is intended to avoid deleting another environment by checking the active state context, not to keep confirmation and review around irreversible resource deletion.
D:That outcome applies to Destroy with preserved external object, intended to stop managing a resource while keeping its real object intact, rather than the question's feature Destroy scope and workspace selection: A removed block with destroy=false or careful state removal can break Terraform management without deleting the object. Unlike Destroy with preserved external object, Destroy scope and workspace selection is intended to avoid deleting another environment by checking the active state context, not to stop managing a resource while keeping its real object intact.
Question 1002
The rollout owner asks whether State and resource addresses is sufficient to track repeated instances independently under count or for_each. Which limitation specifically concerns that mechanism?
- Changing the addressing model can require a migration to preserve bindings.
- It does not grant access to the remote backend.
- The sensitive flag hides display but does not guarantee data is absent from state.
- State still needs refresh checks to recognize external infrastructure changes.
- Removing the configuration alone may plan destruction of the bound object.
Explanation
Correct Answer
A:For State and resource addresses in the task to track repeated instances independently under count or for_each, the important caution is: Changing the addressing model can require a migration to preserve bindings. The reason this matters is its actual behavior: State holds individual addresses such as example[0] or example["dev"] for separate instances.
Incorrect Answers
B:The proposed warning belongs to Terraform state lineage, which serves the different goal to distinguish snapshots belonging to different histories, rather than to State and resource addresses: The lineage identifies a state history and helps detect unrelated snapshots when moving or replacing state. The question concerns State and resource addresses acting to track repeated instances independently under count or for_each, not a limit of Terraform state lineage.
C:The proposed warning belongs to State sensitivity, which serves the different goal to protect state files even when outputs are marked sensitive, rather than to State and resource addresses: Secrets and credentials can occur in Terraform state regardless of CLI redaction settings. The question concerns State and resource addresses acting to track repeated instances independently under count or for_each, not a limit of State sensitivity.
D:The proposed warning belongs to State as synchronization metadata, which serves the different goal to support incremental reconciliation against existing remote objects, rather than to State and resource addresses: Terraform consults state rather than treating each run as a completely new unmanaged deployment. The question concerns State and resource addresses acting to track repeated instances independently under count or for_each, not a limit of State as synchronization metadata.
E:The proposed warning belongs to State binding identity, which serves the different goal to map a Terraform resource address to its real remote object, rather than to State and resource addresses: State records bindings between resource instances and provider-managed objects and holds related metadata. The question concerns State and resource addresses acting to track repeated instances independently under count or for_each, not a limit of State binding identity.
Question 1003
During an implementation review, a Terraform team encounters "Secret rotation and state boundary". Which purpose is associated with that mechanism?
- choose an ephemeral or write-only route when a credential must not persist
- send a secret to a supporting resource without retaining it in Terraform state
- redact secret values from normal Terraform CLI displays
- use a temporary credential without persisting its value into state or plan
Explanation
Correct Answer
A:The practical result of Secret rotation and state boundary, used to choose an ephemeral or write-only route when a credential must not persist, is: Terraform's ephemeral support and provider write-only arguments can avoid persisting supported temporary values. A qualification for this effect is: Ordinary resource arguments marked sensitive can still end up in state.
Incorrect Answers
B:That outcome applies to Provider write-only argument, intended to send a secret to a supporting resource without retaining it in Terraform state, rather than the question's feature Secret rotation and state boundary: A write-only provider argument consumes a value during apply without persisting the argument in state or plan. Unlike Provider write-only argument, Secret rotation and state boundary is intended to choose an ephemeral or write-only route when a credential must not persist, not to send a secret to a supporting resource without retaining it in Terraform state.
C:That outcome applies to Sensitive variable flag, intended to redact secret values from normal Terraform CLI displays, rather than the question's feature Secret rotation and state boundary: sensitive=true marks an input as sensitive and propagates that sensitivity into derived expressions. Unlike Sensitive variable flag, Secret rotation and state boundary is intended to choose an ephemeral or write-only route when a credential must not persist, not to redact secret values from normal Terraform CLI displays.
D:That outcome applies to Ephemeral input variable, intended to use a temporary credential without persisting its value into state or plan, rather than the question's feature Secret rotation and state boundary: ephemeral=true on a variable keeps its value available during the operation but omits it from state and plan files. Unlike Ephemeral input variable, Secret rotation and state boundary is intended to choose an ephemeral or write-only route when a credential must not persist, not to use a temporary credential without persisting its value into state or plan.
Question 1004
A change proposal relies on Destroy scope and workspace selection for the task to avoid deleting another environment by checking the active state context. Which limitation specifically applies to it?
- Deleting configuration without an appropriate state transition generally triggers destruction.
- Provider delete behavior and retention policies differ by object type.
- Identical Terraform files can manage different objects when their states differ.
- Targeting can bypass parts of the normal complete dependency reconciliation.
Explanation
Correct Answer
C:For Destroy scope and workspace selection in the task to avoid deleting another environment by checking the active state context, the important caution is: Identical Terraform files can manage different objects when their states differ. The reason this matters is its actual behavior: Destroy affects managed resources bound to the selected workspace or backend state.
Incorrect Answers
A:The proposed warning belongs to Destroy with preserved external object, which serves the different goal to stop managing a resource while keeping its real object intact, rather than to Destroy scope and workspace selection: A removed block with destroy=false or careful state removal can break Terraform management without deleting the object. The question concerns Destroy scope and workspace selection acting to avoid deleting another environment by checking the active state context, not a limit of Destroy with preserved external object.
B:The proposed warning belongs to Destroy approval safeguards, which serves the different goal to keep confirmation and review around irreversible resource deletion, rather than to Destroy scope and workspace selection: An interactive destroy presents planned removal before approval unless automation bypasses it. The question concerns Destroy scope and workspace selection acting to avoid deleting another environment by checking the active state context, not a limit of Destroy approval safeguards.
D:The proposed warning belongs to Targeted destruction caution, which serves the different goal to limit a destructive operation to a selected object only when necessary, rather than to Destroy scope and workspace selection: terraform destroy -target=ADDRESS restricts action scope for exceptional situations. The question concerns Destroy scope and workspace selection acting to avoid deleting another environment by checking the active state context, not a limit of Targeted destruction caution.
Question 1005
The rollout owner asks whether Secret rotation and state boundary is sufficient to choose an ephemeral or write-only route when a credential must not persist. Which limitation specifically concerns that mechanism?
- Ephemeral resources cannot be referenced in arbitrary persistent resource arguments.
- Ordinary resource arguments marked sensitive can still end up in state.
- The underlying value can still be stored in state and plan artifacts.
- Provider schema support and Terraform 1.11 or later are required.
- Such a value can be referenced only in allowed ephemeral contexts.
Explanation
Correct Answer
B:For Secret rotation and state boundary in the task to choose an ephemeral or write-only route when a credential must not persist, the important caution is: Ordinary resource arguments marked sensitive can still end up in state. The reason this matters is its actual behavior: Terraform's ephemeral support and provider write-only arguments can avoid persisting supported temporary values.
Incorrect Answers
A:The proposed warning belongs to Ephemeral resource block, which serves the different goal to read or generate temporary data for an operation without tracking it in state, rather than to Secret rotation and state boundary: An ephemeral block uses provider-defined temporary resources for supported runtime-only inputs. The question concerns Secret rotation and state boundary acting to choose an ephemeral or write-only route when a credential must not persist, not a limit of Ephemeral resource block.
C:The proposed warning belongs to Sensitive variable flag, which serves the different goal to redact secret values from normal Terraform CLI displays, rather than to Secret rotation and state boundary: sensitive=true marks an input as sensitive and propagates that sensitivity into derived expressions. The question concerns Secret rotation and state boundary acting to choose an ephemeral or write-only route when a credential must not persist, not a limit of Sensitive variable flag.
D:The proposed warning belongs to Provider write-only argument, which serves the different goal to send a secret to a supporting resource without retaining it in Terraform state, rather than to Secret rotation and state boundary: A write-only provider argument consumes a value during apply without persisting the argument in state or plan. The question concerns Secret rotation and state boundary acting to choose an ephemeral or write-only route when a credential must not persist, not a limit of Provider write-only argument.
E:The proposed warning belongs to Ephemeral input variable, which serves the different goal to use a temporary credential without persisting its value into state or plan, rather than to Secret rotation and state boundary: ephemeral=true on a variable keeps its value available during the operation but omits it from state and plan files. The question concerns Secret rotation and state boundary acting to choose an ephemeral or write-only route when a credential must not persist, not a limit of Ephemeral input variable.
Question 1006
A Terraform rollout has two separate requirements: first, track repeated instances independently under count or for_each; second, retain IDs and other provider-returned values for future runs. Which assignment of mechanisms correctly handles both responsibilities?
- First use State and resource addresses; then use Terraform state serial.
- First use Terraform state serial; then use Terraform state lineage.
- First use State and resource addresses; then use Computed resource attributes in state.
- First use Terraform state lineage; then use Computed resource attributes in state.
- First use Computed resource attributes in state; then use State and resource addresses.
Explanation
Correct Answer
C:The first requirement, to track repeated instances independently under count or for_each, is handled by State and resource addresses: State holds individual addresses such as example[0] or example["dev"] for separate instances. The second requirement, to retain IDs and other provider-returned values for future runs, is handled by Computed resource attributes in state: State captures attribute values used to compare current managed objects with desired configuration. Each of these mechanisms has a distinct responsibility.
Incorrect Answers
A:For the requested tasks to track repeated instances independently under count or for_each and retain IDs and other provider-returned values for future runs, the first candidate State and resource addresses addresses track repeated instances independently under count or for_each; the second candidate Terraform state serial addresses identify the revision of a state snapshot. This mapping fails because the second mechanism primarily supports the task to identify the revision of a state snapshot; the actual requirements are track repeated instances independently under count or for_each first and retain IDs and other provider-returned values for future runs second.
B:For the requested tasks to track repeated instances independently under count or for_each and retain IDs and other provider-returned values for future runs, the first candidate Terraform state serial addresses identify the revision of a state snapshot; the second candidate Terraform state lineage addresses distinguish snapshots belonging to different histories. This mapping fails because the first mechanism primarily supports the task to identify the revision of a state snapshot and the second mechanism primarily supports the task to distinguish snapshots belonging to different histories; the actual requirements are track repeated instances independently under count or for_each first and retain IDs and other provider-returned values for future runs second.
D:For the requested tasks to track repeated instances independently under count or for_each and retain IDs and other provider-returned values for future runs, the first candidate Terraform state lineage addresses distinguish snapshots belonging to different histories; the second candidate Computed resource attributes in state addresses retain IDs and other provider-returned values for future runs. This mapping fails because the first mechanism primarily supports the task to distinguish snapshots belonging to different histories; the actual requirements are track repeated instances independently under count or for_each first and retain IDs and other provider-returned values for future runs second.
E:For the requested tasks to track repeated instances independently under count or for_each and retain IDs and other provider-returned values for future runs, the first candidate Computed resource attributes in state addresses retain IDs and other provider-returned values for future runs; the second candidate State and resource addresses addresses track repeated instances independently under count or for_each. This mapping fails because the first mechanism primarily supports the task to retain IDs and other provider-returned values for future runs and the second mechanism primarily supports the task to track repeated instances independently under count or for_each; the actual requirements are track repeated instances independently under count or for_each first and retain IDs and other provider-returned values for future runs second.
Question 1007
A Terraform rollout has two separate requirements: first, choose an ephemeral or write-only route when a credential must not persist; second, use a temporary credential without persisting its value into state or plan. Which assignment of mechanisms correctly handles both responsibilities?
- First use Secret rotation and state boundary; then use Ephemeral input variable.
- First use Ephemeral resource block; then use Ephemeral input variable.
- First use Ephemeral input variable; then use Secret rotation and state boundary.
- First use Provider write-only argument; then use Ephemeral resource block.
- First use Secret rotation and state boundary; then use Provider write-only argument.
Explanation
Correct Answer
A:The first requirement, to choose an ephemeral or write-only route when a credential must not persist, is handled by Secret rotation and state boundary: Terraform's ephemeral support and provider write-only arguments can avoid persisting supported temporary values. The second requirement, to use a temporary credential without persisting its value into state or plan, is handled by Ephemeral input variable: ephemeral=true on a variable keeps its value available during the operation but omits it from state and plan files. Each of these mechanisms has a distinct responsibility.
Incorrect Answers
B:For the requested tasks to choose an ephemeral or write-only route when a credential must not persist and use a temporary credential without persisting its value into state or plan, the first candidate Ephemeral resource block addresses read or generate temporary data for an operation without tracking it in state; the second candidate Ephemeral input variable addresses use a temporary credential without persisting its value into state or plan. This mapping fails because the first mechanism primarily supports the task to read or generate temporary data for an operation without tracking it in state; the actual requirements are choose an ephemeral or write-only route when a credential must not persist first and use a temporary credential without persisting its value into state or plan second.
C:For the requested tasks to choose an ephemeral or write-only route when a credential must not persist and use a temporary credential without persisting its value into state or plan, the first candidate Ephemeral input variable addresses use a temporary credential without persisting its value into state or plan; the second candidate Secret rotation and state boundary addresses choose an ephemeral or write-only route when a credential must not persist. This mapping fails because the first mechanism primarily supports the task to use a temporary credential without persisting its value into state or plan and the second mechanism primarily supports the task to choose an ephemeral or write-only route when a credential must not persist; the actual requirements are choose an ephemeral or write-only route when a credential must not persist first and use a temporary credential without persisting its value into state or plan second.
D:For the requested tasks to choose an ephemeral or write-only route when a credential must not persist and use a temporary credential without persisting its value into state or plan, the first candidate Provider write-only argument addresses send a secret to a supporting resource without retaining it in Terraform state; the second candidate Ephemeral resource block addresses read or generate temporary data for an operation without tracking it in state. This mapping fails because the first mechanism primarily supports the task to send a secret to a supporting resource without retaining it in Terraform state and the second mechanism primarily supports the task to read or generate temporary data for an operation without tracking it in state; the actual requirements are choose an ephemeral or write-only route when a credential must not persist first and use a temporary credential without persisting its value into state or plan second.
E:For the requested tasks to choose an ephemeral or write-only route when a credential must not persist and use a temporary credential without persisting its value into state or plan, the first candidate Secret rotation and state boundary addresses choose an ephemeral or write-only route when a credential must not persist; the second candidate Provider write-only argument addresses send a secret to a supporting resource without retaining it in Terraform state. This mapping fails because the second mechanism primarily supports the task to send a secret to a supporting resource without retaining it in Terraform state; the actual requirements are choose an ephemeral or write-only route when a credential must not persist first and use a temporary credential without persisting its value into state or plan second.
Question 1008
A Terraform rollout has two separate requirements: first, avoid deleting another environment by checking the active state context; second, review a destruction proposal before running it. Which assignment of mechanisms correctly handles both responsibilities?
- First use Destroy scope and workspace selection; then use Specific resource removal from configuration.
- First use Destroy scope and workspace selection; then use Destroy plan preview.
- First use Specific resource removal from configuration; then use Destroy with preserved external object.
- First use Destroy with preserved external object; then use Destroy plan preview.
- First use Destroy plan preview; then use Destroy scope and workspace selection.
Explanation
Correct Answer
B:The first requirement, to avoid deleting another environment by checking the active state context, is handled by Destroy scope and workspace selection: Destroy affects managed resources bound to the selected workspace or backend state. The second requirement, to review a destruction proposal before running it, is handled by Destroy plan preview: terraform plan -destroy produces a plan whose intended effect is to remove managed infrastructure. Each of these mechanisms has a distinct responsibility.
Incorrect Answers
A:For the requested tasks to avoid deleting another environment by checking the active state context and review a destruction proposal before running it, the first candidate Destroy scope and workspace selection addresses avoid deleting another environment by checking the active state context; the second candidate Specific resource removal from configuration addresses plan removal of a managed resource no longer declared in HCL. This mapping fails because the second mechanism primarily supports the task to plan removal of a managed resource no longer declared in HCL; the actual requirements are avoid deleting another environment by checking the active state context first and review a destruction proposal before running it second.
C:For the requested tasks to avoid deleting another environment by checking the active state context and review a destruction proposal before running it, the first candidate Specific resource removal from configuration addresses plan removal of a managed resource no longer declared in HCL; the second candidate Destroy with preserved external object addresses stop managing a resource while keeping its real object intact. This mapping fails because the first mechanism primarily supports the task to plan removal of a managed resource no longer declared in HCL and the second mechanism primarily supports the task to stop managing a resource while keeping its real object intact; the actual requirements are avoid deleting another environment by checking the active state context first and review a destruction proposal before running it second.
D:For the requested tasks to avoid deleting another environment by checking the active state context and review a destruction proposal before running it, the first candidate Destroy with preserved external object addresses stop managing a resource while keeping its real object intact; the second candidate Destroy plan preview addresses review a destruction proposal before running it. This mapping fails because the first mechanism primarily supports the task to stop managing a resource while keeping its real object intact; the actual requirements are avoid deleting another environment by checking the active state context first and review a destruction proposal before running it second.
E:For the requested tasks to avoid deleting another environment by checking the active state context and review a destruction proposal before running it, the first candidate Destroy plan preview addresses review a destruction proposal before running it; the second candidate Destroy scope and workspace selection addresses avoid deleting another environment by checking the active state context. This mapping fails because the first mechanism primarily supports the task to review a destruction proposal before running it and the second mechanism primarily supports the task to avoid deleting another environment by checking the active state context; the actual requirements are avoid deleting another environment by checking the active state context first and review a destruction proposal before running it second.
Question 1009
A Terraform 1.12 configuration evaluates length(split("|", "web|api|db")). Which result follows from the expression as written?
- 5
- 3
- 4
- 2
Explanation
Correct Answer
B:For the specific expression length(split("|", "web|api|db")), First, split divides a pipe-delimited value at each separator; that produces exactly 3 elements; The outer length call counts those resulting elements rather than the original textual arguments.
Incorrect Answers
A:For the concrete expression length(split("|", "web|api|db")), the inner collection has 3 values, not 5; length counts the resulting collection only; the inner stage produces ["web", "api", "db"] before the outer operation is applied.
C:For the concrete expression length(split("|", "web|api|db")), this counts one element beyond the 3 values produced by the inner expression; the inner stage produces ["web", "api", "db"] before the outer operation is applied.
D:For the concrete expression length(split("|", "web|api|db")), this drops one legitimate list element; the inner operation returns 3 values; the inner stage produces ["web", "api", "db"] before the outer operation is applied.
Question 1010
Before continuing an infrastructure rollout, the operator must rewrite Terraform configuration into its canonical layout. Which mechanism most directly meets this particular need?
- terraform fmt command
- terraform fmt -recursive
- terraform fmt -diff
- terraform fmt -check
Explanation
Correct Answer
A:The task is to rewrite Terraform configuration into its canonical layout; terraform fmt command directly supports that requirement: terraform fmt formats Terraform language files consistently, including spacing and alignment. Its relevant boundary is: Formatting does not validate external credentials or apply changes.
Incorrect Answers
B:terraform fmt -recursive is designed to format Terraform configurations in nested local directories, whereas this task is to rewrite Terraform configuration into its canonical layout: The recursive flag expands formatting beyond just the current directory. Against terraform fmt command, its limitation is: It does not fetch remote modules to reformat their source repositories.
C:terraform fmt -diff is designed to display differences that canonical formatting would introduce, whereas this task is to rewrite Terraform configuration into its canonical layout: terraform fmt -diff shows a style diff for files that need formatting. Against terraform fmt command, its limitation is: A style diff is not an infrastructure change plan.
D:terraform fmt -check is designed to fail a style gate without modifying source files, whereas this task is to rewrite Terraform configuration into its canonical layout: terraform fmt -check tests whether files are already formatted and returns an exit status. Against terraform fmt command, its limitation is: The check does not fix configuration automatically.