McAfee-Secured Website

Exam Bundle

Exam Code: Terraform Associate 004

Exam Name HashiCorp Certified: Terraform Associate (004)

Certification Provider: HashiCorp

Corresponding Certification: Terraform Associate

HashiCorp Terraform Associate 004 Bundle $19.99

100% HashiCorp Terraform Associate 004 Guaranteed Success With Testking Training Materials

Get Real Terraform Associate 004 Exam Questions & Expert Verified Answers as Experienced on the Real Exam!

  • Questions & Answers

    Terraform Associate 004 Questions & Answers

    167 Questions & Answers

    The ultimate exam preparation tool, Questions & Answers mirrors the actual Terraform Associate 004 exam while allowing you to hone and measure every aspect of your test-taking ability.

  • Study Guide

    Terraform Associate 004 Study Guide

    285 PDF Pages

    Developed by industry experts, this 285-page guide spells out in painstaking detail all of the information you need to ace Terraform Associate 004 exam.

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

Satisfaction Guaranteed

Money Back Guarantee

Testking provides hassle-free money back guarantee with our products. That is because we have 100% trust in the abilities of our professional and experience product team, and our record is a proof of that.

99.6% PASS RATE
Total Cost: $154.98
Bundle Price: $134.99

Purchase Individually

  • Questions & Answers

    Questions & Answers

    167 Questions

    $124.99
  • Study Guide

    Study Guide

    285 PDF Pages

    $29.99

HashiCorp Terraform Associate 004 Practice Test 17

Question 160

The Terraform change owner at Granite Software Works seeks a verifiable outcome for: A new hire applies Terraform code before initializing its working directory and receives missing-provider errors. Which controlled check would validate the remediation?

  1. Routine runs no longer produce trace output and incident-specific logging remains available when explicitly enabled.
  2. The state path changes as intended while resource API operations still use the explicitly configured provider identity.
  3. The directory initializes successfully and the reviewed plan corresponds to the resulting applied resources.
  4. The destruction plan lists only managed resources and leaves unrelated untracked assets intact.

Explanation

Correct Answer

C:

The directory initializes successfully and the reviewed plan corresponds to the resulting applied resources. This directly verifies the corrective action: Follow the standard workflow: write configuration, terraform init, terraform plan, review, then terraform apply. The measured result specifically addresses the failure at Granite Software Works: A new hire applies Terraform code before initializing its working directory and receives missing-provider errors.

Incorrect Answers

A:

Routine runs no longer produce trace output and incident-specific logging remains available when explicitly enabled. This evidence would validate a DIFFERENT correction: Disable verbose logging after troubleshooting and use the least verbose level that answers the incident question. That different correction addresses: A team leaves TF_LOG=TRACE enabled for every production run and creates large, potentially sensitive logs. It does not establish that the Granite Software Works issue has been corrected: A new hire applies Terraform code before initializing its working directory and receives missing-provider errors. The relevant measured outcome is: The directory initializes successfully and the reviewed plan corresponds to the resulting applied resources.

B:

The state path changes as intended while resource API operations still use the explicitly configured provider identity. This evidence would validate a DIFFERENT correction: Configure backend storage separately from provider authentication and target settings. That different correction addresses: An engineer assumes setting a local backend changes provider credentials and account identity. It does not establish that the Granite Software Works issue has been corrected: A new hire applies Terraform code before initializing its working directory and receives missing-provider errors. The relevant measured outcome is: The directory initializes successfully and the reviewed plan corresponds to the resulting applied resources.

D:

The destruction plan lists only managed resources and leaves unrelated untracked assets intact. This evidence would validate a DIFFERENT correction: Limit destroy expectations to objects tracked in the active state and manage other infrastructure separately. That different correction addresses: A maintainer expects terraform destroy to delete arbitrary infrastructure in the account that Terraform has never managed. It does not establish that the Granite Software Works issue has been corrected: A new hire applies Terraform code before initializing its working directory and receives missing-provider errors. The relevant measured outcome is: The directory initializes successfully and the reviewed plan corresponds to the resulting applied resources.

Question 161

A proposed infrastructure change for Brookhaven Cloud Team must address the following observed failure: A team skips the plan stage and cannot explain why its apply destroyed a gateway. Which engineering change most directly resolves this issue?

  1. Generate and inspect the execution plan before authorizing an apply rather than treating apply as an opaque deployment.
  2. Reference the subnet resource's exported ID attribute in the server argument.
  3. Run terraform fmt -check in CI and fail when formatting changes would be required.
  4. Add a moved block mapping the old resource address to the new address when the object remains the same.

Explanation

Correct Answer

A:

Generate and inspect the execution plan before authorizing an apply rather than treating apply as an opaque deployment. This is targeted to the observed Terraform issue: A team skips the plan stage and cannot explain why its apply destroyed a gateway. At Brookhaven Cloud Team, the acceptance criterion is not merely a valid plan; the team should verify: The replacement is visible to reviewers before any destructive operation begins.

Incorrect Answers

B:

Reference the subnet resource's exported ID attribute in the server argument. This would be suitable for a DIFFERENT Terraform problem: An app server needs the subnet ID created by another resource, but its configuration copies a hardcoded ID from a different account. It does not directly resolve the Brookhaven Cloud Team failure: A team skips the plan stage and cannot explain why its apply destroyed a gateway. The required acceptance evidence instead is: The replacement is visible to reviewers before any destructive operation begins.

C:

Run terraform fmt -check in CI and fail when formatting changes would be required. This would be suitable for a DIFFERENT Terraform problem: A CI job should reject code that is not Terraform-formatted without silently modifying a pull-request checkout. It does not directly resolve the Brookhaven Cloud Team failure: A team skips the plan stage and cannot explain why its apply destroyed a gateway. The required acceptance evidence instead is: The replacement is visible to reviewers before any destructive operation begins.

D:

Add a moved block mapping the old resource address to the new address when the object remains the same. This would be suitable for a DIFFERENT Terraform problem: An engineer renames a Terraform resource block without recording its prior address and gets an unnecessary destroy-and-create plan. It does not directly resolve the Brookhaven Cloud Team failure: A team skips the plan stage and cannot explain why its apply destroyed a gateway. The required acceptance evidence instead is: The replacement is visible to reviewers before any destructive operation begins.

Question 162

The Terraform change owner at Brookhaven Cloud Team seeks a verifiable outcome for: A team skips the plan stage and cannot explain why its apply destroyed a gateway. What acceptance evidence is most relevant to this reported issue?

  1. The plan retains the remote object identity while moving its Terraform address without destructive replacement.
  2. The replacement is visible to reviewers before any destructive operation begins.
  3. A deliberately misformatted fixture fails the check while a formatted one passes.
  4. The dependency graph uses the new subnet ID without manual copying and the plan contains the correct linkage.

Explanation

Correct Answer

B:

The replacement is visible to reviewers before any destructive operation begins. This directly verifies the corrective action: Generate and inspect the execution plan before authorizing an apply rather than treating apply as an opaque deployment. The measured result specifically addresses the failure at Brookhaven Cloud Team: A team skips the plan stage and cannot explain why its apply destroyed a gateway.

Incorrect Answers

A:

The plan retains the remote object identity while moving its Terraform address without destructive replacement. This evidence would validate a DIFFERENT correction: Add a moved block mapping the old resource address to the new address when the object remains the same. That different correction addresses: An engineer renames a Terraform resource block without recording its prior address and gets an unnecessary destroy-and-create plan. It does not establish that the Brookhaven Cloud Team issue has been corrected: A team skips the plan stage and cannot explain why its apply destroyed a gateway. The relevant measured outcome is: The replacement is visible to reviewers before any destructive operation begins.

C:

A deliberately misformatted fixture fails the check while a formatted one passes. This evidence would validate a DIFFERENT correction: Run terraform fmt -check in CI and fail when formatting changes would be required. That different correction addresses: A CI job should reject code that is not Terraform-formatted without silently modifying a pull-request checkout. It does not establish that the Brookhaven Cloud Team issue has been corrected: A team skips the plan stage and cannot explain why its apply destroyed a gateway. The relevant measured outcome is: The replacement is visible to reviewers before any destructive operation begins.

D:

The dependency graph uses the new subnet ID without manual copying and the plan contains the correct linkage. This evidence would validate a DIFFERENT correction: Reference the subnet resource's exported ID attribute in the server argument. That different correction addresses: An app server needs the subnet ID created by another resource, but its configuration copies a hardcoded ID from a different account. It does not establish that the Brookhaven Cloud Team issue has been corrected: A team skips the plan stage and cannot explain why its apply destroyed a gateway. The relevant measured outcome is: The replacement is visible to reviewers before any destructive operation begins.

Question 163

During repository review at Aster Managed Services, the platform team reports: A team skips the plan stage and cannot explain why its apply destroyed a gateway. How should the Terraform engineer correct this specific failure?

  1. Explain that Terraform declares desired manageable resources and reconciles them through provider APIs and tracked state.
  2. Review destroy implications and lifecycle/retention controls before decommissioning managed data services.
  3. Generate and inspect the execution plan before authorizing an apply rather than treating apply as an opaque deployment.
  4. Configure supported HCP Terraform policy enforcement, with appropriate evaluation and required approvals.

Explanation

Correct Answer

C:

Generate and inspect the execution plan before authorizing an apply rather than treating apply as an opaque deployment. This is targeted to the observed Terraform issue: A team skips the plan stage and cannot explain why its apply destroyed a gateway. At Aster Managed Services, the acceptance criterion is not merely a valid plan; the team should verify: The replacement is visible to reviewers before any destructive operation begins.

Incorrect Answers

A:

Explain that Terraform declares desired manageable resources and reconciles them through provider APIs and tracked state. This would be suitable for a DIFFERENT Terraform problem: A service owner believes infrastructure as code requires every physical device to be recreated from scratch during each deployment. It does not directly resolve the Aster Managed Services failure: A team skips the plan stage and cannot explain why its apply destroyed a gateway. The required acceptance evidence instead is: The replacement is visible to reviewers before any destructive operation begins.

B:

Review destroy implications and lifecycle/retention controls before decommissioning managed data services. This would be suitable for a DIFFERENT Terraform problem: A training exercise uses destroy to clear a resource but ignores a required retention policy for its database. It does not directly resolve the Aster Managed Services failure: A team skips the plan stage and cannot explain why its apply destroyed a gateway. The required acceptance evidence instead is: The replacement is visible to reviewers before any destructive operation begins.

D:

Configure supported HCP Terraform policy enforcement, with appropriate evaluation and required approvals. This would be suitable for a DIFFERENT Terraform problem: A compliance group wants to prevent Terraform plans from exposing public storage but the team only documents that policy in a wiki. It does not directly resolve the Aster Managed Services failure: A team skips the plan stage and cannot explain why its apply destroyed a gateway. The required acceptance evidence instead is: The replacement is visible to reviewers before any destructive operation begins.

Question 164

An acceptance reviewer at Aster Managed Services must validate the fix for: A team skips the plan stage and cannot explain why its apply destroyed a gateway. Which verification outcome is the strongest evidence of the required correction?

  1. A deliberately noncompliant speculative plan is blocked or flagged according to the chosen policy enforcement mode.
  2. The review identifies the protected database and prevents unauthorized data destruction.
  3. A no-change review leaves existing managed resources in place while detecting only an intentionally altered configuration field.
  4. The replacement is visible to reviewers before any destructive operation begins.

Explanation

Correct Answer

D:

The replacement is visible to reviewers before any destructive operation begins. This directly verifies the corrective action: Generate and inspect the execution plan before authorizing an apply rather than treating apply as an opaque deployment. The measured result specifically addresses the failure at Aster Managed Services: A team skips the plan stage and cannot explain why its apply destroyed a gateway.

Incorrect Answers

A:

A deliberately noncompliant speculative plan is blocked or flagged according to the chosen policy enforcement mode. This evidence would validate a DIFFERENT correction: Configure supported HCP Terraform policy enforcement, with appropriate evaluation and required approvals. That different correction addresses: A compliance group wants to prevent Terraform plans from exposing public storage but the team only documents that policy in a wiki. It does not establish that the Aster Managed Services issue has been corrected: A team skips the plan stage and cannot explain why its apply destroyed a gateway. The relevant measured outcome is: The replacement is visible to reviewers before any destructive operation begins.

B:

The review identifies the protected database and prevents unauthorized data destruction. This evidence would validate a DIFFERENT correction: Review destroy implications and lifecycle/retention controls before decommissioning managed data services. That different correction addresses: A training exercise uses destroy to clear a resource but ignores a required retention policy for its database. It does not establish that the Aster Managed Services issue has been corrected: A team skips the plan stage and cannot explain why its apply destroyed a gateway. The relevant measured outcome is: The replacement is visible to reviewers before any destructive operation begins.

C:

A no-change review leaves existing managed resources in place while detecting only an intentionally altered configuration field. This evidence would validate a DIFFERENT correction: Explain that Terraform declares desired manageable resources and reconciles them through provider APIs and tracked state. That different correction addresses: A service owner believes infrastructure as code requires every physical device to be recreated from scratch during each deployment. It does not establish that the Aster Managed Services issue has been corrected: A team skips the plan stage and cannot explain why its apply destroyed a gateway. The relevant measured outcome is: The replacement is visible to reviewers before any destructive operation begins.

Question 165

During repository review at Harborline Infrastructure, the platform team reports: A release run compares old configurations against the cloud but never stores the changes that were actually approved. Which proposed fix addresses the reported root cause?

  1. Separate the canonical provider source in required_providers from local provider configuration aliases.
  2. Create a saved plan and apply that exact plan when the environment and approval workflow require consistency.
  3. Pin the Git module source to a reviewed commit or immutable release tag.
  4. Initialize the root directory and then run terraform validate for a meaningful configuration check.

Explanation

Correct Answer

B:

Create a saved plan and apply that exact plan when the environment and approval workflow require consistency. This is targeted to the observed Terraform issue: A release run compares old configurations against the cloud but never stores the changes that were actually approved. At Harborline Infrastructure, the acceptance criterion is not merely a valid plan; the team should verify: The applied actions correspond to the approved saved plan rather than a newly recalculated unreviewed diff.

Incorrect Answers

A:

Separate the canonical provider source in required_providers from local provider configuration aliases. This would be suitable for a DIFFERENT Terraform problem: An engineer uses a provider alias name as the source-address namespace and breaks reproducible provider installation. It does not directly resolve the Harborline Infrastructure failure: A release run compares old configurations against the cloud but never stores the changes that were actually approved. The required acceptance evidence instead is: The applied actions correspond to the approved saved plan rather than a newly recalculated unreviewed diff.

C:

Pin the Git module source to a reviewed commit or immutable release tag. This would be suitable for a DIFFERENT Terraform problem: A Git-based module source points to a mutable main branch and production plans change without a reviewed module upgrade. It does not directly resolve the Harborline Infrastructure failure: A release run compares old configurations against the cloud but never stores the changes that were actually approved. The required acceptance evidence instead is: The applied actions correspond to the approved saved plan rather than a newly recalculated unreviewed diff.

D:

Initialize the root directory and then run terraform validate for a meaningful configuration check. This would be suitable for a DIFFERENT Terraform problem: An engineer runs terraform validate without initialization and misinterprets missing-plugin errors as evidence that all HCL is invalid. It does not directly resolve the Harborline Infrastructure failure: A release run compares old configurations against the cloud but never stores the changes that were actually approved. The required acceptance evidence instead is: The applied actions correspond to the approved saved plan rather than a newly recalculated unreviewed diff.

Question 166

An acceptance reviewer at Harborline Infrastructure must validate the fix for: A release run compares old configurations against the cloud but never stores the changes that were actually approved. What result would demonstrate that the identified problem is actually resolved?

  1. terraform init installs the correct provider source and terraform plan selects the intended alias.
  2. Two clean initializations retrieve the same approved source revision.
  3. The applied actions correspond to the approved saved plan rather than a newly recalculated unreviewed diff.
  4. Validation can load provider schemas and reports actual configuration errors without missing-provider noise.

Explanation

Correct Answer

C:

The applied actions correspond to the approved saved plan rather than a newly recalculated unreviewed diff. This directly verifies the corrective action: Create a saved plan and apply that exact plan when the environment and approval workflow require consistency. The measured result specifically addresses the failure at Harborline Infrastructure: A release run compares old configurations against the cloud but never stores the changes that were actually approved.

Incorrect Answers

A:

terraform init installs the correct provider source and terraform plan selects the intended alias. This evidence would validate a DIFFERENT correction: Separate the canonical provider source in required_providers from local provider configuration aliases. That different correction addresses: An engineer uses a provider alias name as the source-address namespace and breaks reproducible provider installation. It does not establish that the Harborline Infrastructure issue has been corrected: A release run compares old configurations against the cloud but never stores the changes that were actually approved. The relevant measured outcome is: The applied actions correspond to the approved saved plan rather than a newly recalculated unreviewed diff.

B:

Two clean initializations retrieve the same approved source revision. This evidence would validate a DIFFERENT correction: Pin the Git module source to a reviewed commit or immutable release tag. That different correction addresses: A Git-based module source points to a mutable main branch and production plans change without a reviewed module upgrade. It does not establish that the Harborline Infrastructure issue has been corrected: A release run compares old configurations against the cloud but never stores the changes that were actually approved. The relevant measured outcome is: The applied actions correspond to the approved saved plan rather than a newly recalculated unreviewed diff.

D:

Validation can load provider schemas and reports actual configuration errors without missing-provider noise. This evidence would validate a DIFFERENT correction: Initialize the root directory and then run terraform validate for a meaningful configuration check. That different correction addresses: An engineer runs terraform validate without initialization and misinterprets missing-plugin errors as evidence that all HCL is invalid. It does not establish that the Harborline Infrastructure issue has been corrected: A release run compares old configurations against the cloud but never stores the changes that were actually approved. The relevant measured outcome is: The applied actions correspond to the approved saved plan rather than a newly recalculated unreviewed diff.

Question 167

At Beacon Engineering, the Terraform review finds this specific problem: A release run compares old configurations against the cloud but never stores the changes that were actually approved. Which engineering change most directly resolves this issue?

  1. Reference resource instances with their actual for_each keys or derive a map of their attributes.
  2. Set a supported Terraform version in workspace settings and validate the configuration on a controlled speculative run.
  3. Initialize dependencies separately, then use terraform validate to find configuration errors.
  4. Create a saved plan and apply that exact plan when the environment and approval workflow require consistency.

Explanation

Correct Answer

D:

Create a saved plan and apply that exact plan when the environment and approval workflow require consistency. This is targeted to the observed Terraform issue: A release run compares old configurations against the cloud but never stores the changes that were actually approved. At Beacon Engineering, the acceptance criterion is not merely a valid plan; the team should verify: The applied actions correspond to the approved saved plan rather than a newly recalculated unreviewed diff.

Incorrect Answers

A:

Reference resource instances with their actual for_each keys or derive a map of their attributes. This would be suitable for a DIFFERENT Terraform problem: A for_each resource collection is referenced with numeric indexes even though its instances are keyed by map keys. It does not directly resolve the Beacon Engineering failure: A release run compares old configurations against the cloud but never stores the changes that were actually approved. The required acceptance evidence instead is: The applied actions correspond to the approved saved plan rather than a newly recalculated unreviewed diff.

B:

Set a supported Terraform version in workspace settings and validate the configuration on a controlled speculative run. This would be suitable for a DIFFERENT Terraform problem: A platform upgrades the Terraform CLI version for its HCP Terraform workspace without validating version compatibility or plan behavior. It does not directly resolve the Beacon Engineering failure: A release run compares old configurations against the cloud but never stores the changes that were actually approved. The required acceptance evidence instead is: The applied actions correspond to the approved saved plan rather than a newly recalculated unreviewed diff.

C:

Initialize dependencies separately, then use terraform validate to find configuration errors. This would be suitable for a DIFFERENT Terraform problem: A developer assumes terraform init will automatically fix invalid HCL expressions inside resource definitions. It does not directly resolve the Beacon Engineering failure: A release run compares old configurations against the cloud but never stores the changes that were actually approved. The required acceptance evidence instead is: The applied actions correspond to the approved saved plan rather than a newly recalculated unreviewed diff.

Question 168

After corrective work at Beacon Engineering, a reviewer requests measurable proof for: A release run compares old configurations against the cloud but never stores the changes that were actually approved. What acceptance evidence is most relevant to this reported issue?

  1. The applied actions correspond to the approved saved plan rather than a newly recalculated unreviewed diff.
  2. The run uses the documented version and passes its provider/module compatibility checks.
  3. The expression validates and retrieves the intended instance attributes by stable keys.
  4. Init resolves plugins but invalid expressions still produce the expected validation diagnostics.

Explanation

Correct Answer

A:

The applied actions correspond to the approved saved plan rather than a newly recalculated unreviewed diff. This directly verifies the corrective action: Create a saved plan and apply that exact plan when the environment and approval workflow require consistency. The measured result specifically addresses the failure at Beacon Engineering: A release run compares old configurations against the cloud but never stores the changes that were actually approved.

Incorrect Answers

B:

The run uses the documented version and passes its provider/module compatibility checks. This evidence would validate a DIFFERENT correction: Set a supported Terraform version in workspace settings and validate the configuration on a controlled speculative run. That different correction addresses: A platform upgrades the Terraform CLI version for its HCP Terraform workspace without validating version compatibility or plan behavior. It does not establish that the Beacon Engineering issue has been corrected: A release run compares old configurations against the cloud but never stores the changes that were actually approved. The relevant measured outcome is: The applied actions correspond to the approved saved plan rather than a newly recalculated unreviewed diff.

C:

The expression validates and retrieves the intended instance attributes by stable keys. This evidence would validate a DIFFERENT correction: Reference resource instances with their actual for_each keys or derive a map of their attributes. That different correction addresses: A for_each resource collection is referenced with numeric indexes even though its instances are keyed by map keys. It does not establish that the Beacon Engineering issue has been corrected: A release run compares old configurations against the cloud but never stores the changes that were actually approved. The relevant measured outcome is: The applied actions correspond to the approved saved plan rather than a newly recalculated unreviewed diff.

D:

Init resolves plugins but invalid expressions still produce the expected validation diagnostics. This evidence would validate a DIFFERENT correction: Initialize dependencies separately, then use terraform validate to find configuration errors. That different correction addresses: A developer assumes terraform init will automatically fix invalid HCL expressions inside resource definitions. It does not establish that the Beacon Engineering issue has been corrected: A release run compares old configurations against the cloud but never stores the changes that were actually approved. The relevant measured outcome is: The applied actions correspond to the approved saved plan rather than a newly recalculated unreviewed diff.

Question 169

At Evergreen Development, the Terraform review finds this specific problem: An engineer believes terraform validate also creates the declared infrastructure and announces deployment after a successful validation. Which action would best restore the intended infrastructure-as-code workflow?

  1. Run terraform fmt -check in CI and fail when formatting changes would be required.
  2. Pin the module to an explicitly tested compatible version range before the next initialization.
  3. Distinguish syntactic/schema validation from plan and apply, and run the appropriate workflow stage.
  4. Use correctly configured Terraform CLI workspaces or distinct state paths with documented environment isolation.

Explanation

Correct Answer

C:

Distinguish syntactic/schema validation from plan and apply, and run the appropriate workflow stage. This is targeted to the observed Terraform issue: An engineer believes terraform validate also creates the declared infrastructure and announces deployment after a successful validation. At Evergreen Development, the acceptance criterion is not merely a valid plan; the team should verify: Validation reports configuration consistency while the actual resource creation is confirmed only after apply.

Incorrect Answers

A:

Run terraform fmt -check in CI and fail when formatting changes would be required. This would be suitable for a DIFFERENT Terraform problem: A CI job should reject code that is not Terraform-formatted without silently modifying a pull-request checkout. It does not directly resolve the Evergreen Development failure: An engineer believes terraform validate also creates the declared infrastructure and announces deployment after a successful validation. The required acceptance evidence instead is: Validation reports configuration consistency while the actual resource creation is confirmed only after apply.

B:

Pin the module to an explicitly tested compatible version range before the next initialization. This would be suitable for a DIFFERENT Terraform problem: A registry module is referenced without a version constraint and a later major release changes its inputs unexpectedly. It does not directly resolve the Evergreen Development failure: An engineer believes terraform validate also creates the declared infrastructure and announces deployment after a successful validation. The required acceptance evidence instead is: Validation reports configuration consistency while the actual resource creation is confirmed only after apply.

D:

Use correctly configured Terraform CLI workspaces or distinct state paths with documented environment isolation. This would be suitable for a DIFFERENT Terraform problem: A team wants separate isolated states for training and production in a local backend but runs both with the same unseparated state file. It does not directly resolve the Evergreen Development failure: An engineer believes terraform validate also creates the declared infrastructure and announces deployment after a successful validation. The required acceptance evidence instead is: Validation reports configuration consistency while the actual resource creation is confirmed only after apply.

Question 170

After corrective work at Evergreen Development, a reviewer requests measurable proof for: An engineer believes terraform validate also creates the declared infrastructure and announces deployment after a successful validation. Which observation best confirms that the proposed correction worked?

  1. A deliberately misformatted fixture fails the check while a formatted one passes.
  2. A clean init selects the expected release and an unreviewed incompatible major version is excluded.
  3. Each environment's state list contains only its own intended resource addresses.
  4. Validation reports configuration consistency while the actual resource creation is confirmed only after apply.

Explanation

Correct Answer

D:

Validation reports configuration consistency while the actual resource creation is confirmed only after apply. This directly verifies the corrective action: Distinguish syntactic/schema validation from plan and apply, and run the appropriate workflow stage. The measured result specifically addresses the failure at Evergreen Development: An engineer believes terraform validate also creates the declared infrastructure and announces deployment after a successful validation.

Incorrect Answers

A:

A deliberately misformatted fixture fails the check while a formatted one passes. This evidence would validate a DIFFERENT correction: Run terraform fmt -check in CI and fail when formatting changes would be required. That different correction addresses: A CI job should reject code that is not Terraform-formatted without silently modifying a pull-request checkout. It does not establish that the Evergreen Development issue has been corrected: An engineer believes terraform validate also creates the declared infrastructure and announces deployment after a successful validation. The relevant measured outcome is: Validation reports configuration consistency while the actual resource creation is confirmed only after apply.

B:

A clean init selects the expected release and an unreviewed incompatible major version is excluded. This evidence would validate a DIFFERENT correction: Pin the module to an explicitly tested compatible version range before the next initialization. That different correction addresses: A registry module is referenced without a version constraint and a later major release changes its inputs unexpectedly. It does not establish that the Evergreen Development issue has been corrected: An engineer believes terraform validate also creates the declared infrastructure and announces deployment after a successful validation. The relevant measured outcome is: Validation reports configuration consistency while the actual resource creation is confirmed only after apply.

C:

Each environment's state list contains only its own intended resource addresses. This evidence would validate a DIFFERENT correction: Use correctly configured Terraform CLI workspaces or distinct state paths with documented environment isolation. That different correction addresses: A team wants separate isolated states for training and production in a local backend but runs both with the same unseparated state file. It does not establish that the Evergreen Development issue has been corrected: An engineer believes terraform validate also creates the declared infrastructure and announces deployment after a successful validation. The relevant measured outcome is: Validation reports configuration consistency while the actual resource creation is confirmed only after apply.