HashiCorp Terraform Associate 004 Exam Dumps, Practice Test Questions

100% Latest & Updated HashiCorp Terraform Associate 004 Practice Test Questions, Exam Dumps & Verified Answers!
30 Days Free Updates, Instant Download!

HashiCorp Terraform Associate 004 Premium Bundle
$64.98
$54.98

Terraform Associate 004 Premium Bundle

  • Premium File: 167 Questions & Answers. Last update: Nov 9, 2026
  • Study Guide: 285 Pages
  • Latest Questions
  • 100% Accurate Answers
  • Fast Exam Updates

Terraform Associate 004 Premium Bundle

HashiCorp Terraform Associate 004 Premium Bundle
  • Premium File: 167 Questions & Answers. Last update: Nov 9, 2026
  • Study Guide: 285 Pages
  • Latest Questions
  • 100% Accurate Answers
  • Fast Exam Updates
$64.98
$54.98

HashiCorp Terraform Associate 004 Practice Test 33

Question 320

A Terraform platform team is coordinating 3 independent decisions. Workstream A: An operations group wants an infrastructure health assertion that can report a diagnostic without behaving exactly like a resource precondition. and Workstream B: A provider operation fails with an opaque authentication error and an engineer needs temporary, more detailed Terraform diagnostics. and Workstream C: A nightly job wants to detect unexpected pending Terraform changes but should not mutate production resources. Select exactly 3 actions, one addressing each distinct workstream.

  1. Run a speculative terraform plan with the desired inputs and examine its proposed changes.
  2. Use a check block for an appropriate post-deployment assertion, and interpret its warning behavior correctly.
  3. Review the HCL change through version control and inspect a Terraform execution plan before authorized apply.
  4. Set an appropriate TF_LOG level for the troubleshooting session and reproduce the error safely.
  5. Describe the desired networks and dependencies in versioned Terraform configuration and review plans before applying.
  6. Interpret the refreshed plan as detected drift and decide whether to restore declared tags or intentionally update configuration.

Explanation

Correct Answers

A:

For the workstream in which a nightly job wants to detect unexpected pending Terraform changes but should not mutate production resources, use this action: Run a speculative terraform plan with the desired inputs and examine its proposed changes. Plan previews reconciliation; apply would perform changes. Verify: The command returns a plan showing resource actions without executing them. Limitation: A speculative plan can become stale and must not be mistaken for an approval to apply.

B:

For the workstream in which an operations group wants an infrastructure health assertion that can report a diagnostic without behaving exactly like a resource precondition, use this action: Use a check block for an appropriate post-deployment assertion, and interpret its warning behavior correctly. Check blocks support ongoing validation with warning-oriented semantics. Verify: A failed check appears as a diagnostic rather than necessarily blocking the run like a precondition. Limitation: Checks and preconditions have different failure effects, so choose based on governance needs.

D:

For the workstream in which a provider operation fails with an opaque authentication error and an engineer needs temporary, more detailed Terraform diagnostics, use this action: Set an appropriate TF_LOG level for the troubleshooting session and reproduce the error safely. TF_LOG controls Terraform CLI logging verbosity. Verify: Terraform emits relevant diagnostic details to stderr while the log setting is enabled. Limitation: Verbose logs can contain confidential values and should be handled as sensitive evidence.

Incorrect Answers

C:

This action is appropriate instead for a different, unlisted requirement: An operations group wants four engineers to propose a subnet change without all four immediately modifying production. It would be checked by: A pull request includes configuration differences and a plan describing expected resource mutations. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.

E:

This action is appropriate instead for a different, unlisted requirement: A university repeats a six-network, three-environment build by copying screenshots of console clicks, and auditors cannot reconstruct which settings produced the last deployment. It would be checked by: A fresh environment can be planned from the same versioned configuration and its intended change set reviewed. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.

F:

This action is appropriate instead for a different, unlisted requirement: An operations team edits cloud VM tags manually, and normal Terraform plan shows an unexpected change even though HCL has not changed. It would be checked by: The reviewed plan explains which observed remote attributes differ from desired HCL. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.

Question 321

An infrastructure team faces this specific situation: An application secret is supplied as a Terraform variable marked sensitive, and a teammate claims it cannot enter a saved state file. Which Terraform action most directly satisfies the requirement?

  1. Protect state storage and consider ephemeral flow or provider-supported write-only arguments where appropriate, not sensitive alone.
  2. Add an explicit depends_on referencing the policy attachment resource for the hidden operational dependency.
  3. Use an object type constraint within a map or list collection with named attribute types.
  4. Reference the security group resource attribute directly from the database argument.

Explanation

Correct Answer

A:

Protect state storage and consider ephemeral flow or provider-supported write-only arguments where appropriate, not sensitive alone. Secret redaction and secret persistence are distinct Terraform behaviors. Verify: Inspect the chosen mechanism and verify secrets do not appear in plan/state artifacts where omission is required. Limitation: sensitive primarily redacts normal CLI display; it does not by itself exclude a value from state.

Incorrect Answers

B:

This is linked to a different situation: A firewall rule should be provisioned only after a policy attachment exists, but the rule's arguments do not reference that attachment. There the relevant decision is: Add an explicit depends_on referencing the policy attachment resource for the hidden operational dependency. For the question's actual requirement — An application secret is supplied as a Terraform variable marked sensitive, and a teammate claims it cannot enter a saved state file. — the specifically relevant decision is: Protect state storage and consider ephemeral flow or provider-supported write-only arguments where appropriate, not sensitive alone. It would therefore not resolve or assess the case as stated.

C:

This is linked to a different situation: A developer defines a subnet inventory in which every subnet has cidr, zone, and public attributes, and needs reliable shape checking. There the relevant decision is: Use an object type constraint within a map or list collection with named attribute types. For the question's actual requirement — An application secret is supplied as a Terraform variable marked sensitive, and a teammate claims it cannot enter a saved state file. — the specifically relevant decision is: Protect state storage and consider ephemeral flow or provider-supported write-only arguments where appropriate, not sensitive alone. It would therefore not resolve or assess the case as stated.

D:

This is linked to a different situation: A database security group must be passed into a managed database resource without copying IDs into hardcoded variables. There the relevant decision is: Reference the security group resource attribute directly from the database argument. For the question's actual requirement — An application secret is supplied as a Terraform variable marked sensitive, and a teammate claims it cannot enter a saved state file. — the specifically relevant decision is: Protect state storage and consider ephemeral flow or provider-supported write-only arguments where appropriate, not sensitive alone. It would therefore not resolve or assess the case as stated.

Question 322

A reviewer is confirming a change for the following use case: An application secret is supplied as a Terraform variable marked sensitive, and a teammate claims it cannot enter a saved state file. The implementation follows this approach: Protect state storage and consider ephemeral flow or provider-supported write-only arguments where appropriate, not sensitive alone. Which observation or acceptance test most directly verifies the intended result?

  1. A failing postcondition signals an error and prevents downstream dependent actions.
  2. Inspect the chosen mechanism and verify secrets do not appear in plan/state artifacts where omission is required.
  3. Each input rule produces a corresponding nested ingress block in the planned resource.
  4. Plan distinguishes a create action from a read-only query of the existing network.

Explanation

Correct Answer

B:

Acceptance evidence: Inspect the chosen mechanism and verify secrets do not appear in plan/state artifacts where omission is required. It validates the proposed action, protect state storage and consider ephemeral flow or provider-supported write-only arguments where appropriate, not sensitive alone, because secret redaction and secret persistence are distinct Terraform behaviors. Remaining limitation: sensitive primarily redacts normal CLI display; it does not by itself exclude a value from state.

Incorrect Answers

A:

This is linked to a different situation: A managed service should not continue to downstream provisioning if the returned endpoint has an invalid structure. There the relevant acceptance is: A failing postcondition signals an error and prevents downstream dependent actions. For the question's actual requirement — An application secret is supplied as a Terraform variable marked sensitive, and a teammate claims it cannot enter a saved state file. — the specifically relevant acceptance is: Inspect the chosen mechanism and verify secrets do not appear in plan/state artifacts where omission is required. It would therefore not resolve or assess the case as stated.

C:

This is linked to a different situation: A security group requires multiple repeated ingress blocks derived from a variable collection, and copy-pasting blocks is error-prone. There the relevant acceptance is: Each input rule produces a corresponding nested ingress block in the planned resource. For the question's actual requirement — An application secret is supplied as a Terraform variable marked sensitive, and a teammate claims it cannot enter a saved state file. — the specifically relevant acceptance is: Inspect the chosen mechanism and verify secrets do not appear in plan/state artifacts where omission is required. It would therefore not resolve or assess the case as stated.

D:

This is linked to a different situation: A web team must create a new load balancer and also look up an existing shared network ID managed by another team. There the relevant acceptance is: Plan distinguishes a create action from a read-only query of the existing network. For the question's actual requirement — An application secret is supplied as a Terraform variable marked sensitive, and a teammate claims it cannot enter a saved state file. — the specifically relevant acceptance is: Inspect the chosen mechanism and verify secrets do not appear in plan/state artifacts where omission is required. It would therefore not resolve or assess the case as stated.

Question 323

Consider a proposed solution for this requirement: An application secret is supplied as a Terraform variable marked sensitive, and a teammate claims it cannot enter a saved state file. The team plans to do the following: Protect state storage and consider ephemeral flow or provider-supported write-only arguments where appropriate, not sensitive alone. Which limitation or operational caveat must remain in the review?

  1. sensitive primarily redacts normal CLI display; it does not by itself exclude a value from state.
  2. An attribute may be unknown until apply, but Terraform can still preserve the dependency graph.
  3. Sets have no stable order and should not be indexed as though they were lists.
  4. Removing the entire resource block also removes this configuration-based guard; it is not permanent cloud-side deletion protection.

Explanation

Correct Answer

A:

The limitation is sensitive primarily redacts normal CLI display; it does not by itself exclude a value from state. The proposed change is protect state storage and consider ephemeral flow or provider-supported write-only arguments where appropriate, not sensitive alone. Validate it by checking inspect the chosen mechanism and verify secrets do not appear in plan/state artifacts where omission is required. Secret redaction and secret persistence are distinct Terraform behaviors.

Incorrect Answers

B:

This is linked to a different situation: A database security group must be passed into a managed database resource without copying IDs into hardcoded variables. There the relevant limitation is: An attribute may be unknown until apply, but Terraform can still preserve the dependency graph. For the question's actual requirement — An application secret is supplied as a Terraform variable marked sensitive, and a teammate claims it cannot enter a saved state file. — the specifically relevant limitation is: sensitive primarily redacts normal CLI display; it does not by itself exclude a value from state. It would therefore not resolve or assess the case as stated.

C:

This is linked to a different situation: A security allowlist is an unordered set of unique ports and duplicate entries must not affect the configuration. There the relevant limitation is: Sets have no stable order and should not be indexed as though they were lists. For the question's actual requirement — An application secret is supplied as a Terraform variable marked sensitive, and a teammate claims it cannot enter a saved state file. — the specifically relevant limitation is: sensitive primarily redacts normal CLI display; it does not by itself exclude a value from state. It would therefore not resolve or assess the case as stated.

D:

This is linked to a different situation: A team's database must never be accidentally destroyed by a routine Terraform plan while its resource declaration remains managed. There the relevant limitation is: Removing the entire resource block also removes this configuration-based guard; it is not permanent cloud-side deletion protection. For the question's actual requirement — An application secret is supplied as a Terraform variable marked sensitive, and a teammate claims it cannot enter a saved state file. — the specifically relevant limitation is: sensitive primarily redacts normal CLI display; it does not by itself exclude a value from state. It would therefore not resolve or assess the case as stated.

Question 324

The team is reviewing a Terraform implementation for this case: An application secret is supplied as a Terraform variable marked sensitive, and a teammate claims it cannot enter a saved state file. Which tempting assumption would be specifically incorrect for this proposed implementation?

  1. Treat sensitive=true as encryption and guaranteed exclusion of a secret from state.
  2. Assume every failed check block prevents Terraform from applying all resources.
  3. Use an unknown expression branch as though Terraform skips all type checking.
  4. Assume create_before_destroy guarantees zero downtime even when duplicate names are forbidden.

Explanation

Correct Answer

A:

Reject the assumption: Treat sensitive=true as encryption and guaranteed exclusion of a secret from state. Instead, protect state storage and consider ephemeral flow or provider-supported write-only arguments where appropriate, not sensitive alone. Secret redaction and secret persistence are distinct Terraform behaviors. Acceptance evidence: Inspect the chosen mechanism and verify secrets do not appear in plan/state artifacts where omission is required.

Incorrect Answers

B:

This is linked to a different situation: An operations group wants an infrastructure health assertion that can report a diagnostic without behaving exactly like a resource precondition. There the relevant misconception is: Assume every failed check block prevents Terraform from applying all resources. For the question's actual requirement — An application secret is supplied as a Terraform variable marked sensitive, and a teammate claims it cannot enter a saved state file. — the specifically relevant misconception is: Treat sensitive=true as encryption and guaranteed exclusion of a secret from state. It would therefore not resolve or assess the case as stated.

C:

This is linked to a different situation: A deployment needs to choose a service hostname based on whether the environment is production. There the relevant misconception is: Use an unknown expression branch as though Terraform skips all type checking. For the question's actual requirement — An application secret is supplied as a Terraform variable marked sensitive, and a teammate claims it cannot enter a saved state file. — the specifically relevant misconception is: Treat sensitive=true as encryption and guaranteed exclusion of a secret from state. It would therefore not resolve or assess the case as stated.

D:

This is linked to a different situation: A service cannot tolerate downtime when replacing a VM and the provider's planned operation requires destroy-and-create. There the relevant misconception is: Assume create_before_destroy guarantees zero downtime even when duplicate names are forbidden. For the question's actual requirement — An application secret is supplied as a Terraform variable marked sensitive, and a teammate claims it cannot enter a saved state file. — the specifically relevant misconception is: Treat sensitive=true as encryption and guaranteed exclusion of a secret from state. It would therefore not resolve or assess the case as stated.

Question 325

A Terraform platform team is coordinating 2 independent decisions. Workstream A: An application secret is supplied as a Terraform variable marked sensitive, and a teammate claims it cannot enter a saved state file. and Workstream B: A CI team wants to preserve Terraform debug output to a controlled file for a short-lived investigation. Select exactly 2 actions, one addressing each distinct workstream.

  1. Refer to the indexed module instance, such as module.worker[1].endpoint, with an appropriate count expression.
  2. Set TF_LOG and TF_LOG_PATH together, collect the protected log, then disable verbose logging.
  3. Protect state storage and consider ephemeral flow or provider-supported write-only arguments where appropriate, not sensitive alone.
  4. Run a refresh-only plan, review its state changes, and apply refresh-only if the update is appropriate.
  5. Run terraform init -upgrade after reviewing the intended provider compatibility change.

Explanation

Correct Answers

B:

For the workstream in which a CI team wants to preserve Terraform debug output to a controlled file for a short-lived investigation, use this action: Set TF_LOG and TF_LOG_PATH together, collect the protected log, then disable verbose logging. Both a logging level and destination are needed for persistent debug output. Verify: The configured log file contains the expected Terraform diagnostics from the run. Limitation: TF_LOG_PATH alone does not enable logging, and logs must not be casually shared.

C:

For the workstream in which an application secret is supplied as a Terraform variable marked sensitive, and a teammate claims it cannot enter a saved state file, use this action: Protect state storage and consider ephemeral flow or provider-supported write-only arguments where appropriate, not sensitive alone. Secret redaction and secret persistence are distinct Terraform behaviors. Verify: Inspect the chosen mechanism and verify secrets do not appear in plan/state artifacts where omission is required. Limitation: sensitive primarily redacts normal CLI display; it does not by itself exclude a value from state.

Incorrect Answers

A:

This option addresses a separate requirement: A deployment calls a reusable module with count = 3 and must reference the output of only the second instance. Evidence for that other requirement would be the plan resolves the output for the intended counted module instance; neither listed workstream asks for it.

D:

This option addresses a separate requirement: A company intentionally altered remote settings and wants Terraform state to reflect the real objects without proposing configuration-driven remediation yet. Evidence for that other requirement would be state and root outputs synchronize with observed remote data without changing the cloud object itself; neither listed workstream asks for it.

E:

This option addresses a separate requirement: A project intentionally needs a newer provider version allowed by its constraints, but init keeps reusing the version recorded in the lock file. Evidence for that other requirement would be the updated .terraform.lock.hcl records the newly selected compatible provider and its checksums; neither listed workstream asks for it.

Question 326

An infrastructure team faces this specific situation: A database API supports a write-only password argument and the team must avoid persisting the initial password to state. Which Terraform action most directly satisfies the requirement?

  1. Declare map(string) as the input type and select an entry by key, such as var.instance_class["staging"].
  2. Use a resource precondition whose condition can be evaluated before the relevant resource operation.
  3. Use lifecycle ignore_changes for the specifically shared tag attribute after agreeing which system owns it.
  4. Use a provider-supported write-only argument, optionally supplied by an ephemeral value, with appropriate versioning.

Explanation

Correct Answer

D:

Use a provider-supported write-only argument, optionally supplied by an ephemeral value, with appropriate versioning. Write-only arguments are designed to pass temporary values without recording them in state. Verify: The resource operation consumes the password while the Terraform plan and state omit the write-only value. Limitation: Only explicitly write-only provider arguments qualify; an arbitrary normal password argument is not automatically safe.

Incorrect Answers

A:

This is linked to a different situation: A configuration needs a map from environment names to individually selected instance classes, with each value a string. There the relevant decision is: Declare map(string) as the input type and select an entry by key, such as var.instance_class["staging"]. For the question's actual requirement — A database API supports a write-only password argument and the team must avoid persisting the initial password to state. — the specifically relevant decision is: Use a provider-supported write-only argument, optionally supplied by an ephemeral value, with appropriate versioning. It would therefore not resolve or assess the case as stated.

B:

This is linked to a different situation: A team must verify a network policy's expected input range before taking an action that would violate the rule. There the relevant decision is: Use a resource precondition whose condition can be evaluated before the relevant resource operation. For the question's actual requirement — A database API supports a write-only password argument and the team must avoid persisting the initial password to state. — the specifically relevant decision is: Use a provider-supported write-only argument, optionally supplied by an ephemeral value, with appropriate versioning. It would therefore not resolve or assess the case as stated.

C:

This is linked to a different situation: A managed resource's tag is updated by an external compliance agent, and Terraform must not revert only that tag on every plan. There the relevant decision is: Use lifecycle ignore_changes for the specifically shared tag attribute after agreeing which system owns it. For the question's actual requirement — A database API supports a write-only password argument and the team must avoid persisting the initial password to state. — the specifically relevant decision is: Use a provider-supported write-only argument, optionally supplied by an ephemeral value, with appropriate versioning. It would therefore not resolve or assess the case as stated.

Question 327

A reviewer is confirming a change for the following use case: A database API supports a write-only password argument and the team must avoid persisting the initial password to state. The implementation follows this approach: Use a provider-supported write-only argument, optionally supplied by an ephemeral value, with appropriate versioning. Which observation or acceptance test most directly verifies the intended result?

  1. Subsequent plans avoid proposing updates solely because the ignored tag changed outside Terraform.
  2. The plan resolves the image lookup and uses its ID in the VM resource configuration.
  3. A failed check appears as a diagnostic rather than necessarily blocking the run like a precondition.
  4. The resource operation consumes the password while the Terraform plan and state omit the write-only value.

Explanation

Correct Answer

D:

Acceptance evidence: The resource operation consumes the password while the Terraform plan and state omit the write-only value. It validates the proposed action, use a provider-supported write-only argument, optionally supplied by an ephemeral value, with appropriate versioning, because write-only arguments are designed to pass temporary values without recording them in state. Remaining limitation: Only explicitly write-only provider arguments qualify; an arbitrary normal password argument is not automatically safe.

Incorrect Answers

A:

This is linked to a different situation: A managed resource's tag is updated by an external compliance agent, and Terraform must not revert only that tag on every plan. There the relevant acceptance is: Subsequent plans avoid proposing updates solely because the ignored tag changed outside Terraform. For the question's actual requirement — A database API supports a write-only password argument and the team must avoid persisting the initial password to state. — the specifically relevant acceptance is: The resource operation consumes the password while the Terraform plan and state omit the write-only value. It would therefore not resolve or assess the case as stated.

B:

This is linked to a different situation: A module uses a provider data source to find the newest image and a resource block to launch a VM from its returned identifier. There the relevant acceptance is: The plan resolves the image lookup and uses its ID in the VM resource configuration. For the question's actual requirement — A database API supports a write-only password argument and the team must avoid persisting the initial password to state. — the specifically relevant acceptance is: The resource operation consumes the password while the Terraform plan and state omit the write-only value. It would therefore not resolve or assess the case as stated.

C:

This is linked to a different situation: An operations group wants an infrastructure health assertion that can report a diagnostic without behaving exactly like a resource precondition. There the relevant acceptance is: A failed check appears as a diagnostic rather than necessarily blocking the run like a precondition. For the question's actual requirement — A database API supports a write-only password argument and the team must avoid persisting the initial password to state. — the specifically relevant acceptance is: The resource operation consumes the password while the Terraform plan and state omit the write-only value. It would therefore not resolve or assess the case as stated.

Question 328

Consider a proposed solution for this requirement: A database API supports a write-only password argument and the team must avoid persisting the initial password to state. The team plans to do the following: Use a provider-supported write-only argument, optionally supplied by an ephemeral value, with appropriate versioning. Which limitation or operational caveat must remain in the review?

  1. Checks and preconditions have different failure effects, so choose based on governance needs.
  2. An output does not create the referenced endpoint, and sensitive output values need safe handling.
  3. Only explicitly write-only provider arguments qualify; an arbitrary normal password argument is not automatically safe.
  4. dynamic can generate normal nested blocks, not arbitrary provider meta-arguments or resource blocks.

Explanation

Correct Answer

C:

The limitation is only explicitly write-only provider arguments qualify; an arbitrary normal password argument is not automatically safe. The proposed change is use a provider-supported write-only argument, optionally supplied by an ephemeral value, with appropriate versioning. Validate it by checking the resource operation consumes the password while the Terraform plan and state omit the write-only value. Write-only arguments are designed to pass temporary values without recording them in state.

Incorrect Answers

A:

This is linked to a different situation: An operations group wants an infrastructure health assertion that can report a diagnostic without behaving exactly like a resource precondition. There the relevant limitation is: Checks and preconditions have different failure effects, so choose based on governance needs. For the question's actual requirement — A database API supports a write-only password argument and the team must avoid persisting the initial password to state. — the specifically relevant limitation is: Only explicitly write-only provider arguments qualify; an arbitrary normal password argument is not automatically safe. It would therefore not resolve or assess the case as stated.

B:

This is linked to a different situation: An operations team must surface a load balancer endpoint after apply so downstream jobs can consume it. There the relevant limitation is: An output does not create the referenced endpoint, and sensitive output values need safe handling. For the question's actual requirement — A database API supports a write-only password argument and the team must avoid persisting the initial password to state. — the specifically relevant limitation is: Only explicitly write-only provider arguments qualify; an arbitrary normal password argument is not automatically safe. It would therefore not resolve or assess the case as stated.

D:

This is linked to a different situation: A security group requires multiple repeated ingress blocks derived from a variable collection, and copy-pasting blocks is error-prone. There the relevant limitation is: dynamic can generate normal nested blocks, not arbitrary provider meta-arguments or resource blocks. For the question's actual requirement — A database API supports a write-only password argument and the team must avoid persisting the initial password to state. — the specifically relevant limitation is: Only explicitly write-only provider arguments qualify; an arbitrary normal password argument is not automatically safe. It would therefore not resolve or assess the case as stated.

Question 329

The team is reviewing a Terraform implementation for this case: A database API supports a write-only password argument and the team must avoid persisting the initial password to state. Which tempting assumption would be specifically incorrect for this proposed implementation?

  1. Assume prevent_destroy continues to protect an object after the containing resource block is deleted.
  2. Use type string for the entire nested subnet inventory and rely on implicit parsing of every field.
  3. Use dynamic to create multiple top-level resource blocks directly inside one resource.
  4. Pass a password to an ordinary tracked resource attribute and expect Terraform to erase it from all artifacts.

Explanation

Correct Answer

D:

Reject the assumption: Pass a password to an ordinary tracked resource attribute and expect Terraform to erase it from all artifacts. Instead, use a provider-supported write-only argument, optionally supplied by an ephemeral value, with appropriate versioning. Write-only arguments are designed to pass temporary values without recording them in state. Acceptance evidence: The resource operation consumes the password while the Terraform plan and state omit the write-only value.

Incorrect Answers

A:

This is linked to a different situation: A team's database must never be accidentally destroyed by a routine Terraform plan while its resource declaration remains managed. There the relevant misconception is: Assume prevent_destroy continues to protect an object after the containing resource block is deleted. For the question's actual requirement — A database API supports a write-only password argument and the team must avoid persisting the initial password to state. — the specifically relevant misconception is: Pass a password to an ordinary tracked resource attribute and expect Terraform to erase it from all artifacts. It would therefore not resolve or assess the case as stated.

B:

This is linked to a different situation: A developer defines a subnet inventory in which every subnet has cidr, zone, and public attributes, and needs reliable shape checking. There the relevant misconception is: Use type string for the entire nested subnet inventory and rely on implicit parsing of every field. For the question's actual requirement — A database API supports a write-only password argument and the team must avoid persisting the initial password to state. — the specifically relevant misconception is: Pass a password to an ordinary tracked resource attribute and expect Terraform to erase it from all artifacts. It would therefore not resolve or assess the case as stated.

C:

This is linked to a different situation: A security group requires multiple repeated ingress blocks derived from a variable collection, and copy-pasting blocks is error-prone. There the relevant misconception is: Use dynamic to create multiple top-level resource blocks directly inside one resource. For the question's actual requirement — A database API supports a write-only password argument and the team must avoid persisting the initial password to state. — the specifically relevant misconception is: Pass a password to an ordinary tracked resource attribute and expect Terraform to erase it from all artifacts. It would therefore not resolve or assess the case as stated.

Question 330

A Terraform platform team is coordinating 3 independent decisions. Workstream A: A database API supports a write-only password argument and the team must avoid persisting the initial password to state. and Workstream B: An operator leaves TF_LOG=TRACE enabled in production for all runs and sees excessive potentially sensitive logs. and Workstream C: An engineer clones a Terraform repository and sees an error that provider plugins are not installed. Select exactly 3 actions, one addressing each distinct workstream.

  1. Create an HCP Terraform workspace and configure an appropriate remote execution workflow with secure credentials.
  2. Use an advisory policy enforcement setting on the learning workspaces and monitor the warnings.
  3. Use the cloud integration block for workspace mapping and authenticate with terraform login securely.
  4. Use a provider-supported write-only argument, optionally supplied by an ephemeral value, with appropriate versioning.
  5. Run terraform init in the root module directory to initialize backend, modules, and providers.
  6. Disable or lower TF_LOG after collecting the targeted diagnostic evidence.

Explanation

Correct Answers

D:

For the workstream in which a database API supports a write-only password argument and the team must avoid persisting the initial password to state, use this action: Use a provider-supported write-only argument, optionally supplied by an ephemeral value, with appropriate versioning. Write-only arguments are designed to pass temporary values without recording them in state. Verify: The resource operation consumes the password while the Terraform plan and state omit the write-only value. Limitation: Only explicitly write-only provider arguments qualify; an arbitrary normal password argument is not automatically safe.

E:

For the workstream in which an engineer clones a Terraform repository and sees an error that provider plugins are not installed, use this action: Run terraform init in the root module directory to initialize backend, modules, and providers. Initialization prepares the workspace rather than applying infrastructure resources. Verify: The .terraform working data and dependency lock file reflect successful initialization. Limitation: Init does not create configured cloud infrastructure merely by installing plugins.

F:

For the workstream in which an operator leaves TF_LOG=TRACE enabled in production for all runs and sees excessive potentially sensitive logs, use this action: Disable or lower TF_LOG after collecting the targeted diagnostic evidence. Logging scope and lifecycle must be controlled because verbose provider interaction details can reveal secrets. Verify: Subsequent normal runs no longer emit verbose tracing to the same log destination. Limitation: Disabling logs prevents future emission but does not erase previously collected sensitive log files.

Incorrect Answers

A:

This action is appropriate instead for a different, unlisted requirement: A small team needs managed Terraform state and remotely executed infrastructure runs with shared visibility rather than running only from laptops. It would be checked by: Plans and applies run under the HCP workspace and its state versions are centrally accessible to authorized users. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.

B:

This action is appropriate instead for a different, unlisted requirement: A security team wants engineers to see policy violations without initially blocking learning-environment applies. It would be checked by: Violating plans produce visible advisory policy findings while runs remain allowed to continue. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.

C:

This action is appropriate instead for a different, unlisted requirement: A local Terraform root must be connected to a specific HCP Terraform workspace without storing an API token in version control. It would be checked by: CLI commands authenticate to the correct HCP organization/workspace and work with managed remote state. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.

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

UP

SPECIAL OFFER: GET 10% OFF

This is ONE TIME OFFER

ExamSnap Discount Offer
Enter Your Email Address to Receive Your 10% Off Discount Code

A confirmation link will be sent to this email address to verify your login. *We value your privacy. We will not rent or sell your email address.

Download Free Demo of VCE Exam Simulator

Experience Avanset VCE Exam Simulator for yourself.

Simply submit your e-mail address below to get started with our interactive software demo of your free trial.

Free Demo Limits: In the demo version you will be able to access only first 5 questions from exam.