mcAfee Secure Website
23

HashiCorp Terraform Associate 004 Bundle

Exam Code: Terraform Associate 004

Exam Name HashiCorp Certified: Terraform Associate (004)

Certification Provider: HashiCorp

Corresponding Certification: Terraform Associate

Terraform Associate 004 Training Materials $44.99

Reliable & Actual Study Materials for Terraform Associate 004 Exam Success

The Latest Terraform Associate 004 Exam Questions as Experienced in the Actual Test!

  • 24
    Questions & Answers

    Terraform Associate 004 Questions & Answers

    167 Questions & Answers

    Includes questions types found on actual exam such as drag and drop, simulation, type in, and fill in the blank.

  • 25
    Terraform Associate 004 Video Course

    Terraform Associate 004 Training Course

    118 Video Lectures

    Based on Real Life Scenarios which you will encounter in exam and learn by working with real equipment.

  • exam =30
    Study Guide

    Terraform Associate 004 Study Guide

    285 PDF Pages

    Study Guide developed by industry experts who have written exams in the past. They are technology-specific IT certification researchers with at least a decade of experience at Fortune 500 companies.

exam =32

HashiCorp Certified: Terraform Associate (004) (Terraform Associate 004) Practice Tests

Guarantee

Satisfaction Guaranteed

Pass4sure has a remarkable HashiCorp Candidate Success record. We're confident of our products and provide no hassle product exchange. That's how confident we are!

99.3% Pass Rate
Total Cost: $194.97
Bundle Price: $149.98

Purchase Individually

  • exam =34
    Questions & Answers

    Questions & Answers

    167 Questions

    $124.99
    exam =35
  • exam =37
    Terraform Associate 004 Video Course

    Training Course

    118 Video Lectures

    $39.99
  • exam =36
    Study Guide

    Study Guide

    285 PDF Pages

    $29.99

HashiCorp Terraform Associate 004 Practice Test 43

Question 420

A Terraform associate evaluates: An engineer asks when a lifecycle condition is preferable to a general diagnostic check. Select TWO complementary responses: the appropriate action AND direct evidence it worked.

  1. The resource graph includes the required ordering without invented dependencies between unrelated resources.
  2. Use a variable validation block with a clear condition and error message to reject invalid caller inputs before changes are planned.
  3. Trying to reach directly into a child module's private resource address bypasses the module interface.
  4. A purposely violated precondition blocks the operation while an independent check reports its observed condition as designed.
  5. Use lifecycle precondition or postcondition for enforceable resource assertions and check blocks for nonblocking health diagnostics when appropriate.

Explanation

Correct Answers

D:

The observed situation is: An engineer asks when a lifecycle condition is preferable to a general diagnostic check. The acceptance evidence is: A purposely violated precondition blocks the operation while an independent check reports its observed condition as designed. It verifies the corrective approach (Use lifecycle precondition or postcondition for enforceable resource assertions and check blocks for nonblocking health diagnostics when appropriate.) and controls the risk: Confusing advisory checks with hard validation gates can let an unsafe value pass despite a warning. Checking an unrelated Terraform setting would not prove the stated requirement was met.

E:

The case says: An engineer asks when a lifecycle condition is preferable to a general diagnostic check. The directly relevant Terraform response is: Use lifecycle precondition or postcondition for enforceable resource assertions and check blocks for nonblocking health diagnostics when appropriate. This addresses the related failure mode: Confusing advisory checks with hard validation gates can let an unsafe value pass despite a warning. Validate the result by checking: A purposely violated precondition blocks the operation while an independent check reports its observed condition as designed. The selection matches this objective, rather than a different Terraform administration task.

Incorrect Answers

A:

The resource graph includes the required ordering without invented dependencies between unrelated resources. This belongs to Explicit depends_on for hidden dependencies (official objective 4f). Its separate risk is that terraform may not infer relationships that have no data reference, but excessive explicit dependencies can make plans unnecessarily conservative. The question instead tests Preconditions postconditions and checks; that other safeguard alone does not verify it.

B:

Use a variable validation block with a clear condition and error message to reject invalid caller inputs before changes are planned. This is relevant to Input variable validation rules (official objective 4g). Its distinct failure risk is that malformed input values can drive unsupported sizes or unsafe configuration even when their basic types are valid. The present question tests Preconditions postconditions and checks, which this measure alone does not establish.

C:

Trying to reach directly into a child module's private resource address bypasses the module interface. That is the exact risk associated with Cross-module output references (official objective 4b), not the required Preconditions postconditions and checks outcome.

Question 421

A Terraform engineer reports: A short-lived deployment token is needed only while running a provider operation. Which action BEST addresses the specific Terraform Associate (004) requirement?

  1. Use lifecycle precondition or postcondition for enforceable resource assertions and check blocks for nonblocking health diagnostics when appropriate.
  2. Use sensitive to redact CLI display and ephemeral for supported temporary values that must be omitted from plan and state, respecting context restrictions.
  3. Reference a managed resource attribute directly in another resource argument so Terraform creates the appropriate dependency graph.
  4. Pass secrets through provider-supported write-only arguments and appropriate Vault or ephemeral sources, checking provider versions and never logging values.

Explanation

Correct Answer

B:

The case says: A short-lived deployment token is needed only while running a provider operation. The directly relevant Terraform response is: Use sensitive to redact CLI display and ephemeral for supported temporary values that must be omitted from plan and state, respecting context restrictions. This addresses the related failure mode: A secret can still appear in state despite sensitive=true and may require an ephemeral value path to avoid persistence. Validate the result by checking: State and plan inspections confirm approved temporary credentials are omitted and ordinary sensitive outputs are redacted. The selection matches this objective, rather than a different Terraform administration task.

Incorrect Answers

A:

Use lifecycle precondition or postcondition for enforceable resource assertions and check blocks for nonblocking health diagnostics when appropriate. This belongs to Preconditions postconditions and checks (official objective 4g). Its separate risk is that confusing advisory checks with hard validation gates can let an unsafe value pass despite a warning. The question instead tests Sensitive variables versus ephemeral variables; that other safeguard alone does not verify it.

C:

Reference a managed resource attribute directly in another resource argument so Terraform creates the appropriate dependency graph. That addresses Implicit dependency through attribute reference (official objective 4b), specifically the hazard that hardcoding an anticipated ID bypasses Terraform's graph and can reference a stale or nonexistent object. Here the necessary action or evidence is Use sensitive to redact CLI display and ephemeral for supported temporary values that must be omitted from plan and state, respecting context restrictions, not that separate control.

D:

Pass secrets through provider-supported write-only arguments and appropriate Vault or ephemeral sources, checking provider versions and never logging values. This addresses Provider write-only arguments and Vault integration (official objective 4h). The separate hazard is that using an ordinary resource argument can persist secrets in state, while unsupported write-only fields cannot be assumed to exist. It does not by itself satisfy the case-specific requirement for Sensitive variables versus ephemeral variables.

Question 422

After a reviewed change, the team checks: A short-lived deployment token is needed only while running a provider operation. Which evidence MOST directly proves the selected approach is working?

  1. The resource graph includes the required ordering without invented dependencies between unrelated resources.
  2. State and plan inspections confirm approved temporary credentials are omitted and ordinary sensitive outputs are redacted.
  3. A supported write-only argument updates the target without storing the supplied secret in state or plan.
  4. A plan shows the intended input values for the selected environment and variable validation accepts them.

Explanation

Correct Answer

B:

The observed situation is: A short-lived deployment token is needed only while running a provider operation. The acceptance evidence is: State and plan inspections confirm approved temporary credentials are omitted and ordinary sensitive outputs are redacted. It verifies the corrective approach (Use sensitive to redact CLI display and ephemeral for supported temporary values that must be omitted from plan and state, respecting context restrictions.) and controls the risk: A secret can still appear in state despite sensitive=true and may require an ephemeral value path to avoid persistence. Checking an unrelated Terraform setting would not prove the stated requirement was met.

Incorrect Answers

A:

The resource graph includes the required ordering without invented dependencies between unrelated resources. This belongs to Explicit depends_on for hidden dependencies (official objective 4f). Its separate risk is that terraform may not infer relationships that have no data reference, but excessive explicit dependencies can make plans unnecessarily conservative. The question instead tests Sensitive variables versus ephemeral variables; that other safeguard alone does not verify it.

C:

A supported write-only argument updates the target without storing the supplied secret in state or plan. That addresses Provider write-only arguments and Vault integration (official objective 4h), specifically the hazard that using an ordinary resource argument can persist secrets in state, while unsupported write-only fields cannot be assumed to exist. Here the necessary action or evidence is State and plan inspections confirm approved temporary credentials are omitted and ordinary sensitive outputs are redacted, not that separate control.

D:

A plan shows the intended input values for the selected environment and variable validation accepts them. This addresses Input variables and default or CLI overrides (official objective 4c). The separate hazard is that hardcoded environment values in shared configuration create accidental cross-environment changes. It does not by itself satisfy the case-specific requirement for Sensitive variables versus ephemeral variables.

Question 423

A configuration review reveals: A developer thinks sensitive=true prevents a variable from being stored in state. Which action BEST addresses the specific Terraform Associate (004) requirement?

  1. Use Terraform expressions and built-in functions such as merge, lookup, length and format to compute values reproducibly from configuration inputs.
  2. Pass secrets through provider-supported write-only arguments and appropriate Vault or ephemeral sources, checking provider versions and never logging values.
  3. Declare outputs for intended consumer values and mark sensitive outputs appropriately while separately protecting any state that may contain them.
  4. Use sensitive to redact CLI display and ephemeral for supported temporary values that must be omitted from plan and state, respecting context restrictions.

Explanation

Correct Answer

D:

The case says: A developer thinks sensitive=true prevents a variable from being stored in state. The directly relevant Terraform response is: Use sensitive to redact CLI display and ephemeral for supported temporary values that must be omitted from plan and state, respecting context restrictions. This addresses the related failure mode: A secret can still appear in state despite sensitive=true and may require an ephemeral value path to avoid persistence. Validate the result by checking: State and plan inspections confirm approved temporary credentials are omitted and ordinary sensitive outputs are redacted. The selection matches this objective, rather than a different Terraform administration task.

Incorrect Answers

A:

Use Terraform expressions and built-in functions such as merge, lookup, length and format to compute values reproducibly from configuration inputs. This belongs to Terraform expressions and built-in functions (official objective 4e). Its separate risk is that manually duplicating derived labels and tags across resources invites inconsistency and errors. The question instead tests Sensitive variables versus ephemeral variables; that other safeguard alone does not verify it.

B:

Pass secrets through provider-supported write-only arguments and appropriate Vault or ephemeral sources, checking provider versions and never logging values. This is relevant to Provider write-only arguments and Vault integration (official objective 4h). Its distinct failure risk is that using an ordinary resource argument can persist secrets in state, while unsupported write-only fields cannot be assumed to exist. The present question tests Sensitive variables versus ephemeral variables, which this measure alone does not establish.

C:

Declare outputs for intended consumer values and mark sensitive outputs appropriately while separately protecting any state that may contain them. That addresses Outputs and sensitive display control (official objective 4c), specifically the hazard that a sensitive output designation hides normal CLI disclosure but does not guarantee the underlying state contains no secret. Here the necessary action or evidence is Use sensitive to redact CLI display and ephemeral for supported temporary values that must be omitted from plan and state, respecting context restrictions, not that separate control.

Question 424

A Terraform governance audit identifies: A developer thinks sensitive=true prevents a variable from being stored in state. What risk MOST directly explains why a correction is needed?

  1. A secret can still appear in state despite sensitive=true and may require an ephemeral value path to avoid persistence.
  2. Removing a middle entry from a count-indexed collection can shift addresses and provoke unintended replacements.
  3. Using an ordinary resource argument can persist secrets in state, while unsupported write-only fields cannot be assumed to exist.
  4. Using a set where stable indices are required can make addressing and ordering assumptions invalid.

Explanation

Correct Answer

A:

The reported issue (A developer thinks sensitive=true prevents a variable from being stored in state) exposes the risk: A secret can still appear in state despite sensitive=true and may require an ephemeral value path to avoid persistence. The corrective action is: Use sensitive to redact CLI display and ephemeral for supported temporary values that must be omitted from plan and state, respecting context restrictions. Confirm with: State and plan inspections confirm approved temporary credentials are omitted and ordinary sensitive outputs are redacted. The risk is specific to this configuration or operation, not an unrelated Terraform feature.

Incorrect Answers

B:

Removing a middle entry from a count-indexed collection can shift addresses and provoke unintended replacements. This is relevant to count versus for_each stable addressing (official objective 4e). Its distinct failure risk is that removing a middle entry from a count-indexed collection can shift addresses and provoke unintended replacements. The present question tests Sensitive variables versus ephemeral variables, which this measure alone does not establish.

C:

Using an ordinary resource argument can persist secrets in state, while unsupported write-only fields cannot be assumed to exist. That is the exact risk associated with Provider write-only arguments and Vault integration (official objective 4h), not the required Sensitive variables versus ephemeral variables outcome.

D:

Using a set where stable indices are required can make addressing and ordering assumptions invalid. This addresses Terraform list set and map collections (official objective 4d). The separate hazard is that using a set where stable indices are required can make addressing and ordering assumptions invalid. It does not by itself satisfy the case-specific requirement for Sensitive variables versus ephemeral variables.

Question 425

During a controlled infrastructure change, a team observes: An input includes a temporary session credential that must not persist in Terraform artifacts. Which action BEST addresses the specific Terraform Associate (004) requirement?

  1. Use sensitive to redact CLI display and ephemeral for supported temporary values that must be omitted from plan and state, respecting context restrictions.
  2. Use lifecycle precondition or postcondition for enforceable resource assertions and check blocks for nonblocking health diagnostics when appropriate.
  3. Pass secrets through provider-supported write-only arguments and appropriate Vault or ephemeral sources, checking provider versions and never logging values.
  4. Declare outputs for intended consumer values and mark sensitive outputs appropriately while separately protecting any state that may contain them.

Explanation

Correct Answer

A:

The case says: An input includes a temporary session credential that must not persist in Terraform artifacts. The directly relevant Terraform response is: Use sensitive to redact CLI display and ephemeral for supported temporary values that must be omitted from plan and state, respecting context restrictions. This addresses the related failure mode: A secret can still appear in state despite sensitive=true and may require an ephemeral value path to avoid persistence. Validate the result by checking: State and plan inspections confirm approved temporary credentials are omitted and ordinary sensitive outputs are redacted. The selection matches this objective, rather than a different Terraform administration task.

Incorrect Answers

B:

Use lifecycle precondition or postcondition for enforceable resource assertions and check blocks for nonblocking health diagnostics when appropriate. This is relevant to Preconditions postconditions and checks (official objective 4g). Its distinct failure risk is that confusing advisory checks with hard validation gates can let an unsafe value pass despite a warning. The present question tests Sensitive variables versus ephemeral variables, which this measure alone does not establish.

C:

Pass secrets through provider-supported write-only arguments and appropriate Vault or ephemeral sources, checking provider versions and never logging values. That addresses Provider write-only arguments and Vault integration (official objective 4h), specifically the hazard that using an ordinary resource argument can persist secrets in state, while unsupported write-only fields cannot be assumed to exist. Here the necessary action or evidence is Use sensitive to redact CLI display and ephemeral for supported temporary values that must be omitted from plan and state, respecting context restrictions, not that separate control.

D:

Declare outputs for intended consumer values and mark sensitive outputs appropriately while separately protecting any state that may contain them. This addresses Outputs and sensitive display control (official objective 4c). The separate hazard is that a sensitive output designation hides normal CLI disclosure but does not guarantee the underlying state contains no secret. It does not by itself satisfy the case-specific requirement for Sensitive variables versus ephemeral variables.

Question 426

An operator wants proof regarding: An input includes a temporary session credential that must not persist in Terraform artifacts. Which evidence MOST directly proves the selected approach is working?

  1. The plan creates only declared managed resources while existing data-source objects are read and remain unmanaged.
  2. A supported write-only argument updates the target without storing the supplied secret in state or plan.
  3. The replacement plan shows create-before-destroy ordering and a test confirms provider constraints permit both instances.
  4. State and plan inspections confirm approved temporary credentials are omitted and ordinary sensitive outputs are redacted.

Explanation

Correct Answer

D:

The observed situation is: An input includes a temporary session credential that must not persist in Terraform artifacts. The acceptance evidence is: State and plan inspections confirm approved temporary credentials are omitted and ordinary sensitive outputs are redacted. It verifies the corrective approach (Use sensitive to redact CLI display and ephemeral for supported temporary values that must be omitted from plan and state, respecting context restrictions.) and controls the risk: A secret can still appear in state despite sensitive=true and may require an ephemeral value path to avoid persistence. Checking an unrelated Terraform setting would not prove the stated requirement was met.

Incorrect Answers

A:

The plan creates only declared managed resources while existing data-source objects are read and remain unmanaged. This belongs to Managed resources versus data sources (official objective 4a). Its separate risk is that a data source query alone will not create or delete the referenced infrastructure object. The question instead tests Sensitive variables versus ephemeral variables; that other safeguard alone does not verify it.

B:

A supported write-only argument updates the target without storing the supplied secret in state or plan. This is relevant to Provider write-only arguments and Vault integration (official objective 4h). Its distinct failure risk is that using an ordinary resource argument can persist secrets in state, while unsupported write-only fields cannot be assumed to exist. The present question tests Sensitive variables versus ephemeral variables, which this measure alone does not establish.

C:

The replacement plan shows create-before-destroy ordering and a test confirms provider constraints permit both instances. That addresses Lifecycle create_before_destroy (official objective 4f), specifically the hazard that a replacement may fail if a globally unique name prevents a second object from existing simultaneously. Here the necessary action or evidence is State and plan inspections confirm approved temporary credentials are omitted and ordinary sensitive outputs are redacted, not that separate control.

Question 427

An infrastructure deployment design calls for: A module needs to distinguish display redaction from ephemeral data lifecycle. Which action BEST addresses the specific Terraform Associate (004) requirement?

  1. Use lifecycle precondition or postcondition for enforceable resource assertions and check blocks for nonblocking health diagnostics when appropriate.
  2. Use sensitive to redact CLI display and ephemeral for supported temporary values that must be omitted from plan and state, respecting context restrictions.
  3. Use a provider data source that matches a unique existing remote object and feed its returned attributes into managed resource arguments.
  4. Pass secrets through provider-supported write-only arguments and appropriate Vault or ephemeral sources, checking provider versions and never logging values.

Explanation

Correct Answer

B:

The case says: A module needs to distinguish display redaction from ephemeral data lifecycle. The directly relevant Terraform response is: Use sensitive to redact CLI display and ephemeral for supported temporary values that must be omitted from plan and state, respecting context restrictions. This addresses the related failure mode: A secret can still appear in state despite sensitive=true and may require an ephemeral value path to avoid persistence. Validate the result by checking: State and plan inspections confirm approved temporary credentials are omitted and ordinary sensitive outputs are redacted. The selection matches this objective, rather than a different Terraform administration task.

Incorrect Answers

A:

Use lifecycle precondition or postcondition for enforceable resource assertions and check blocks for nonblocking health diagnostics when appropriate. This belongs to Preconditions postconditions and checks (official objective 4g). Its separate risk is that confusing advisory checks with hard validation gates can let an unsafe value pass despite a warning. The question instead tests Sensitive variables versus ephemeral variables; that other safeguard alone does not verify it.

C:

Use a provider data source that matches a unique existing remote object and feed its returned attributes into managed resource arguments. That addresses Read-only data source lookup (official objective 4a), specifically the hazard that an ambiguous or missing data-source match can fail planning or target the wrong existing resource. Here the necessary action or evidence is Use sensitive to redact CLI display and ephemeral for supported temporary values that must be omitted from plan and state, respecting context restrictions, not that separate control.

D:

Pass secrets through provider-supported write-only arguments and appropriate Vault or ephemeral sources, checking provider versions and never logging values. This addresses Provider write-only arguments and Vault integration (official objective 4h). The separate hazard is that using an ordinary resource argument can persist secrets in state, while unsupported write-only fields cannot be assumed to exist. It does not by itself satisfy the case-specific requirement for Sensitive variables versus ephemeral variables.

Question 428

A production-readiness review highlights: A module needs to distinguish display redaction from ephemeral data lifecycle. What risk MOST directly explains why a correction is needed?

  1. Using an ordinary resource argument can persist secrets in state, while unsupported write-only fields cannot be assumed to exist.
  2. A replacement may fail if a globally unique name prevents a second object from existing simultaneously.
  3. A data source query alone will not create or delete the referenced infrastructure object.
  4. A secret can still appear in state despite sensitive=true and may require an ephemeral value path to avoid persistence.

Explanation

Correct Answer

D:

The reported issue (A module needs to distinguish display redaction from ephemeral data lifecycle) exposes the risk: A secret can still appear in state despite sensitive=true and may require an ephemeral value path to avoid persistence. The corrective action is: Use sensitive to redact CLI display and ephemeral for supported temporary values that must be omitted from plan and state, respecting context restrictions. Confirm with: State and plan inspections confirm approved temporary credentials are omitted and ordinary sensitive outputs are redacted. The risk is specific to this configuration or operation, not an unrelated Terraform feature.

Incorrect Answers

A:

Using an ordinary resource argument can persist secrets in state, while unsupported write-only fields cannot be assumed to exist. This belongs to Provider write-only arguments and Vault integration (official objective 4h). Its separate risk is that using an ordinary resource argument can persist secrets in state, while unsupported write-only fields cannot be assumed to exist. The question instead tests Sensitive variables versus ephemeral variables; that other safeguard alone does not verify it.

B:

A replacement may fail if a globally unique name prevents a second object from existing simultaneously. This is relevant to Lifecycle create_before_destroy (official objective 4f). Its distinct failure risk is that a replacement may fail if a globally unique name prevents a second object from existing simultaneously. The present question tests Sensitive variables versus ephemeral variables, which this measure alone does not establish.

C:

A data source query alone will not create or delete the referenced infrastructure object. That is the exact risk associated with Managed resources versus data sources (official objective 4a), not the required Sensitive variables versus ephemeral variables outcome.

Question 429

An operations team needs to resolve: A security review asks why a password remains in state even after its input variable is marked sensitive. Which action BEST addresses the specific Terraform Associate (004) requirement?

  1. Use for_each keyed by stable resource identifiers for collections whose entries change independently and count for genuinely index-oriented repetition.
  2. Use sensitive to redact CLI display and ephemeral for supported temporary values that must be omitted from plan and state, respecting context restrictions.
  3. Pass secrets through provider-supported write-only arguments and appropriate Vault or ephemeral sources, checking provider versions and never logging values.
  4. Select list when element order and duplicates matter, set for unique unordered values, and map for values indexed by string keys.

Explanation

Correct Answer

B:

The case says: A security review asks why a password remains in state even after its input variable is marked sensitive. The directly relevant Terraform response is: Use sensitive to redact CLI display and ephemeral for supported temporary values that must be omitted from plan and state, respecting context restrictions. This addresses the related failure mode: A secret can still appear in state despite sensitive=true and may require an ephemeral value path to avoid persistence. Validate the result by checking: State and plan inspections confirm approved temporary credentials are omitted and ordinary sensitive outputs are redacted. The selection matches this objective, rather than a different Terraform administration task.

Incorrect Answers

A:

Use for_each keyed by stable resource identifiers for collections whose entries change independently and count for genuinely index-oriented repetition. This belongs to count versus for_each stable addressing (official objective 4e). Its separate risk is that removing a middle entry from a count-indexed collection can shift addresses and provoke unintended replacements. The question instead tests Sensitive variables versus ephemeral variables; that other safeguard alone does not verify it.

C:

Pass secrets through provider-supported write-only arguments and appropriate Vault or ephemeral sources, checking provider versions and never logging values. That addresses Provider write-only arguments and Vault integration (official objective 4h), specifically the hazard that using an ordinary resource argument can persist secrets in state, while unsupported write-only fields cannot be assumed to exist. Here the necessary action or evidence is Use sensitive to redact CLI display and ephemeral for supported temporary values that must be omitted from plan and state, respecting context restrictions, not that separate control.

D:

Select list when element order and duplicates matter, set for unique unordered values, and map for values indexed by string keys. This addresses Terraform list set and map collections (official objective 4d). The separate hazard is that using a set where stable indices are required can make addressing and ordering assumptions invalid. It does not by itself satisfy the case-specific requirement for Sensitive variables versus ephemeral variables.

Question 430

A Terraform associate evaluates: A security review asks why a password remains in state even after its input variable is marked sensitive. Select TWO complementary responses: the appropriate action AND direct evidence it worked.

  1. An authorized workflow can consume the output while casual CLI display is redacted and backend access remains restricted.
  2. State and plan inspections confirm approved temporary credentials are omitted and ordinary sensitive outputs are redacted.
  3. Pass secrets through provider-supported write-only arguments and appropriate Vault or ephemeral sources, checking provider versions and never logging values.
  4. Treating a structured object like an untyped string makes required fields and attribute access error-prone.
  5. Use sensitive to redact CLI display and ephemeral for supported temporary values that must be omitted from plan and state, respecting context restrictions.

Explanation

Correct Answers

B:

The observed situation is: A security review asks why a password remains in state even after its input variable is marked sensitive. The acceptance evidence is: State and plan inspections confirm approved temporary credentials are omitted and ordinary sensitive outputs are redacted. It verifies the corrective approach (Use sensitive to redact CLI display and ephemeral for supported temporary values that must be omitted from plan and state, respecting context restrictions.) and controls the risk: A secret can still appear in state despite sensitive=true and may require an ephemeral value path to avoid persistence. Checking an unrelated Terraform setting would not prove the stated requirement was met.

E:

The case says: A security review asks why a password remains in state even after its input variable is marked sensitive. The directly relevant Terraform response is: Use sensitive to redact CLI display and ephemeral for supported temporary values that must be omitted from plan and state, respecting context restrictions. This addresses the related failure mode: A secret can still appear in state despite sensitive=true and may require an ephemeral value path to avoid persistence. Validate the result by checking: State and plan inspections confirm approved temporary credentials are omitted and ordinary sensitive outputs are redacted. The selection matches this objective, rather than a different Terraform administration task.

Incorrect Answers

A:

An authorized workflow can consume the output while casual CLI display is redacted and backend access remains restricted. This belongs to Outputs and sensitive display control (official objective 4c). Its separate risk is that a sensitive output designation hides normal CLI disclosure but does not guarantee the underlying state contains no secret. The question instead tests Sensitive variables versus ephemeral variables; that other safeguard alone does not verify it.

C:

Pass secrets through provider-supported write-only arguments and appropriate Vault or ephemeral sources, checking provider versions and never logging values. That addresses Provider write-only arguments and Vault integration (official objective 4h), specifically the hazard that using an ordinary resource argument can persist secrets in state, while unsupported write-only fields cannot be assumed to exist. Here the necessary action or evidence is the paired action State and plan inspections confirm approved temporary credentials are omitted and ordinary sensitive outputs are redacted and separate validation Use sensitive to redact CLI display and ephemeral for supported temporary values that must be omitted from plan and state, respecting context restrictions, not that separate control.

D:

Treating a structured object like an untyped string makes required fields and attribute access error-prone. This addresses Object and tuple structural types (official objective 4d). The separate hazard is that treating a structured object like an untyped string makes required fields and attribute access error-prone. It does not by itself satisfy the case-specific requirement for Sensitive variables versus ephemeral variables.