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 42

Question 410

After corrective work at Eastbridge Operations, a reviewer requests measurable proof for: A team assumes a for expression automatically filters unwanted records without an if clause. Which observation best confirms that the proposed correction worked?

  1. Planning shows the rule consumes the service address and succeeds without a fixed sleep interval.
  2. The output enumerates the expected managed addresses from the active state.
  3. A second plan against unchanged configuration and infrastructure proposes no unnecessary new resources.
  4. The evaluated collection excludes disabled records and retains the correct keyed or ordered values.

Explanation

Correct Answer

D:

The evaluated collection excludes disabled records and retains the correct keyed or ordered values. This directly verifies the corrective action: Use a for expression with a deliberate filtering condition to produce only selected items. The measured result specifically addresses the failure at Eastbridge Operations: A team assumes a for expression automatically filters unwanted records without an if clause.

Incorrect Answers

A:

Planning shows the rule consumes the service address and succeeds without a fixed sleep interval. This evidence would validate a DIFFERENT correction: Create a direct resource-attribute reference that establishes the dependency through Terraform's graph. That different correction addresses: A security rule depends on a newly created service address, but an engineer adds an arbitrary time delay instead of a reference. It does not establish that the Eastbridge Operations issue has been corrected: A team assumes a for expression automatically filters unwanted records without an if clause. The relevant measured outcome is: The evaluated collection excludes disabled records and retains the correct keyed or ordered values.

B:

The output enumerates the expected managed addresses from the active state. This evidence would validate a DIFFERENT correction: Run terraform state list against the selected initialized backend and workspace. That different correction addresses: A maintainer needs a list of addresses tracked by the current Terraform state and attempts to infer them from cloud console screenshots. It does not establish that the Eastbridge Operations issue has been corrected: A team assumes a for expression automatically filters unwanted records without an if clause. The relevant measured outcome is: The evaluated collection excludes disabled records and retains the correct keyed or ordered values.

C:

A second plan against unchanged configuration and infrastructure proposes no unnecessary new resources. This evidence would validate a DIFFERENT correction: Use Terraform's declarative resource definitions and plan/apply reconciliation instead of imperative replay of creation commands. That different correction addresses: An operator treats Terraform as a one-time shell script and expects it to replay every creation command identically on each run. It does not establish that the Eastbridge Operations issue has been corrected: A team assumes a for expression automatically filters unwanted records without an if clause. The relevant measured outcome is: The evaluated collection excludes disabled records and retains the correct keyed or ordered values.

Question 411

The infrastructure engineers at Harborline Infrastructure document the following failure during a change review: A team assumes a for expression automatically filters unwanted records without an if clause. Which proposed fix addresses the reported root cause?

  1. Use a for expression with a deliberate filtering condition to produce only selected items.
  2. Handle the documented detailed exit codes: zero for no changes, two for changes, and one for errors.
  3. Run terraform init -upgrade after reviewing the desired module version change.
  4. Give the bucket a single responsible resource owner and let other configurations consume a data lookup or approved outputs.

Explanation

Correct Answer

A:

Use a for expression with a deliberate filtering condition to produce only selected items. This is targeted to the observed Terraform issue: A team assumes a for expression automatically filters unwanted records without an if clause. At Harborline Infrastructure, the acceptance criterion is not merely a valid plan; the team should verify: The evaluated collection excludes disabled records and retains the correct keyed or ordered values.

Incorrect Answers

B:

Handle the documented detailed exit codes: zero for no changes, two for changes, and one for errors. This would be suitable for a DIFFERENT Terraform problem: A CI job invokes terraform plan -detailed-exitcode but treats a change-detected exit status as a tool failure. It does not directly resolve the Harborline Infrastructure failure: A team assumes a for expression automatically filters unwanted records without an if clause. The required acceptance evidence instead is: The evaluated collection excludes disabled records and retains the correct keyed or ordered values.

C:

Run terraform init -upgrade after reviewing the desired module version change. This would be suitable for a DIFFERENT Terraform problem: A team changes the registry module version constraint but still uses the previously installed module code. It does not directly resolve the Harborline Infrastructure failure: A team assumes a for expression automatically filters unwanted records without an if clause. The required acceptance evidence instead is: The evaluated collection excludes disabled records and retains the correct keyed or ordered values.

D:

Give the bucket a single responsible resource owner and let other configurations consume a data lookup or approved outputs. This would be suitable for a DIFFERENT Terraform problem: A migration design unintentionally manages the same existing bucket in two root modules and causes competing changes. It does not directly resolve the Harborline Infrastructure failure: A team assumes a for expression automatically filters unwanted records without an if clause. The required acceptance evidence instead is: The evaluated collection excludes disabled records and retains the correct keyed or ordered values.

Question 412

The reliability team at Harborline Infrastructure is closing an incident described as follows: A team assumes a for expression automatically filters unwanted records without an if clause. What result would demonstrate that the identified problem is actually resolved?

  1. The installed module version matches the updated constraint and its interface passes validation.
  2. The evaluated collection excludes disabled records and retains the correct keyed or ordered values.
  3. Only one state contains the managed bucket address while consumers read the shared identifier without duplicate ownership.
  4. The CI decision distinguishes a legitimate diff from a genuine planning error without skipping review.

Explanation

Correct Answer

B:

The evaluated collection excludes disabled records and retains the correct keyed or ordered values. This directly verifies the corrective action: Use a for expression with a deliberate filtering condition to produce only selected items. The measured result specifically addresses the failure at Harborline Infrastructure: A team assumes a for expression automatically filters unwanted records without an if clause.

Incorrect Answers

A:

The installed module version matches the updated constraint and its interface passes validation. This evidence would validate a DIFFERENT correction: Run terraform init -upgrade after reviewing the desired module version change. That different correction addresses: A team changes the registry module version constraint but still uses the previously installed module code. It does not establish that the Harborline Infrastructure issue has been corrected: A team assumes a for expression automatically filters unwanted records without an if clause. The relevant measured outcome is: The evaluated collection excludes disabled records and retains the correct keyed or ordered values.

C:

Only one state contains the managed bucket address while consumers read the shared identifier without duplicate ownership. This evidence would validate a DIFFERENT correction: Give the bucket a single responsible resource owner and let other configurations consume a data lookup or approved outputs. That different correction addresses: A migration design unintentionally manages the same existing bucket in two root modules and causes competing changes. It does not establish that the Harborline Infrastructure issue has been corrected: A team assumes a for expression automatically filters unwanted records without an if clause. The relevant measured outcome is: The evaluated collection excludes disabled records and retains the correct keyed or ordered values.

D:

The CI decision distinguishes a legitimate diff from a genuine planning error without skipping review. This evidence would validate a DIFFERENT correction: Handle the documented detailed exit codes: zero for no changes, two for changes, and one for errors. That different correction addresses: A CI job invokes terraform plan -detailed-exitcode but treats a change-detected exit status as a tool failure. It does not establish that the Harborline Infrastructure issue has been corrected: A team assumes a for expression automatically filters unwanted records without an if clause. The relevant measured outcome is: The evaluated collection excludes disabled records and retains the correct keyed or ordered values.

Question 413

The infrastructure engineers at Westfield Digital Systems document the following failure during a change review: An operator uses a conditional expression with incompatible branch value types and receives a configuration type error. What is the most appropriate corrective action for this Terraform scenario?

  1. Use a carefully reviewed refresh-only planning/apply workflow appropriate to the documented case.
  2. Use an appropriately scoped identity and verify the supported API permissions before rerunning the reviewed operation.
  3. Use a data block to read the existing image and reserve a resource block for objects Terraform should create or manage.
  4. Make both branches return compatible types and keep the condition a Boolean expression.

Explanation

Correct Answer

D:

Make both branches return compatible types and keep the condition a Boolean expression. This is targeted to the observed Terraform issue: An operator uses a conditional expression with incompatible branch value types and receives a configuration type error. At Westfield Digital Systems, the acceptance criterion is not merely a valid plan; the team should verify: terraform validate succeeds and both condition paths evaluate to the expected type.

Incorrect Answers

A:

Use a carefully reviewed refresh-only planning/apply workflow appropriate to the documented case. This would be suitable for a DIFFERENT Terraform problem: A service owner intentionally accepts a remote field change but wants to update state observations without applying unrelated configuration changes. It does not directly resolve the Westfield Digital Systems failure: An operator uses a conditional expression with incompatible branch value types and receives a configuration type error. The required acceptance evidence instead is: terraform validate succeeds and both condition paths evaluate to the expected type.

B:

Use an appropriately scoped identity and verify the supported API permissions before rerunning the reviewed operation. This would be suitable for a DIFFERENT Terraform problem: A plan succeeds but apply fails because runtime credentials lack permission to create one target resource. It does not directly resolve the Westfield Digital Systems failure: An operator uses a conditional expression with incompatible branch value types and receives a configuration type error. The required acceptance evidence instead is: terraform validate succeeds and both condition paths evaluate to the expected type.

C:

Use a data block to read the existing image and reserve a resource block for objects Terraform should create or manage. This would be suitable for a DIFFERENT Terraform problem: A service team declares an existing shared image as a managed resource even though it only needs to discover its identifier for new instances. It does not directly resolve the Westfield Digital Systems failure: An operator uses a conditional expression with incompatible branch value types and receives a configuration type error. The required acceptance evidence instead is: terraform validate succeeds and both condition paths evaluate to the expected type.

Question 414

The reliability team at Westfield Digital Systems is closing an incident described as follows: An operator uses a conditional expression with incompatible branch value types and receives a configuration type error. Which controlled check would validate the remediation?

  1. terraform validate succeeds and both condition paths evaluate to the expected type.
  2. The authorized apply succeeds without granting unrelated administrator permissions.
  3. The plan reads the discovered image without proposing to create or replace that preexisting image.
  4. The accepted refresh-only operation updates recorded observations without executing unrelated configuration-driven resource modifications.

Explanation

Correct Answer

A:

terraform validate succeeds and both condition paths evaluate to the expected type. This directly verifies the corrective action: Make both branches return compatible types and keep the condition a Boolean expression. The measured result specifically addresses the failure at Westfield Digital Systems: An operator uses a conditional expression with incompatible branch value types and receives a configuration type error.

Incorrect Answers

B:

The authorized apply succeeds without granting unrelated administrator permissions. This evidence would validate a DIFFERENT correction: Use an appropriately scoped identity and verify the supported API permissions before rerunning the reviewed operation. That different correction addresses: A plan succeeds but apply fails because runtime credentials lack permission to create one target resource. It does not establish that the Westfield Digital Systems issue has been corrected: An operator uses a conditional expression with incompatible branch value types and receives a configuration type error. The relevant measured outcome is: terraform validate succeeds and both condition paths evaluate to the expected type.

C:

The plan reads the discovered image without proposing to create or replace that preexisting image. This evidence would validate a DIFFERENT correction: Use a data block to read the existing image and reserve a resource block for objects Terraform should create or manage. That different correction addresses: A service team declares an existing shared image as a managed resource even though it only needs to discover its identifier for new instances. It does not establish that the Westfield Digital Systems issue has been corrected: An operator uses a conditional expression with incompatible branch value types and receives a configuration type error. The relevant measured outcome is: terraform validate succeeds and both condition paths evaluate to the expected type.

D:

The accepted refresh-only operation updates recorded observations without executing unrelated configuration-driven resource modifications. This evidence would validate a DIFFERENT correction: Use a carefully reviewed refresh-only planning/apply workflow appropriate to the documented case. That different correction addresses: A service owner intentionally accepts a remote field change but wants to update state observations without applying unrelated configuration changes. It does not establish that the Westfield Digital Systems issue has been corrected: An operator uses a conditional expression with incompatible branch value types and receives a configuration type error. The relevant measured outcome is: terraform validate succeeds and both condition paths evaluate to the expected type.

Question 415

Evergreen Development is preparing a controlled Terraform update after identifying this fault: An operator uses a conditional expression with incompatible branch value types and receives a configuration type error. Which action would best restore the intended infrastructure-as-code workflow?

  1. Configure appropriate providers for each supported service in the same Terraform dependency graph.
  2. Make both branches return compatible types and keep the condition a Boolean expression.
  3. Use Terraform's supported refresh and state tools rather than manually rewriting state internals.
  4. Add an explicit child output block and reference it through the module namespace from the root.

Explanation

Correct Answer

B:

Make both branches return compatible types and keep the condition a Boolean expression. This is targeted to the observed Terraform issue: An operator uses a conditional expression with incompatible branch value types and receives a configuration type error. At Evergreen Development, the acceptance criterion is not merely a valid plan; the team should verify: terraform validate succeeds and both condition paths evaluate to the expected type.

Incorrect Answers

A:

Configure appropriate providers for each supported service in the same Terraform dependency graph. This would be suitable for a DIFFERENT Terraform problem: A deployment needs both cloud DNS and a SaaS monitoring check, but the team assumes Terraform can manage only one vendor's infrastructure. It does not directly resolve the Evergreen Development failure: An operator uses a conditional expression with incompatible branch value types and receives a configuration type error. The required acceptance evidence instead is: terraform validate succeeds and both condition paths evaluate to the expected type.

C:

Use Terraform's supported refresh and state tools rather than manually rewriting state internals. This would be suitable for a DIFFERENT Terraform problem: A drift incident shows a deleted remote resource still present in state, but the team assumes every state change requires editing JSON manually. It does not directly resolve the Evergreen Development failure: An operator uses a conditional expression with incompatible branch value types and receives a configuration type error. The required acceptance evidence instead is: terraform validate succeeds and both condition paths evaluate to the expected type.

D:

Add an explicit child output block and reference it through the module namespace from the root. This would be suitable for a DIFFERENT Terraform problem: A deployment consumes an output from a child module but forgets to declare the output in the module itself. It does not directly resolve the Evergreen Development failure: An operator uses a conditional expression with incompatible branch value types and receives a configuration type error. The required acceptance evidence instead is: terraform validate succeeds and both condition paths evaluate to the expected type.

Question 416

Evergreen Development requires independent evidence before signing off this Terraform correction: An operator uses a conditional expression with incompatible branch value types and receives a configuration type error. Which observation best confirms that the proposed correction worked?

  1. A controlled refreshed plan records the missing object and proposes only the expected corrective action.
  2. The plan includes the cloud DNS record and monitoring check, each handled through the correct provider.
  3. terraform validate succeeds and both condition paths evaluate to the expected type.
  4. Validation resolves the child output and the value appears after successful creation.

Explanation

Correct Answer

C:

terraform validate succeeds and both condition paths evaluate to the expected type. This directly verifies the corrective action: Make both branches return compatible types and keep the condition a Boolean expression. The measured result specifically addresses the failure at Evergreen Development: An operator uses a conditional expression with incompatible branch value types and receives a configuration type error.

Incorrect Answers

A:

A controlled refreshed plan records the missing object and proposes only the expected corrective action. This evidence would validate a DIFFERENT correction: Use Terraform's supported refresh and state tools rather than manually rewriting state internals. That different correction addresses: A drift incident shows a deleted remote resource still present in state, but the team assumes every state change requires editing JSON manually. It does not establish that the Evergreen Development issue has been corrected: An operator uses a conditional expression with incompatible branch value types and receives a configuration type error. The relevant measured outcome is: terraform validate succeeds and both condition paths evaluate to the expected type.

B:

The plan includes the cloud DNS record and monitoring check, each handled through the correct provider. This evidence would validate a DIFFERENT correction: Configure appropriate providers for each supported service in the same Terraform dependency graph. That different correction addresses: A deployment needs both cloud DNS and a SaaS monitoring check, but the team assumes Terraform can manage only one vendor's infrastructure. It does not establish that the Evergreen Development issue has been corrected: An operator uses a conditional expression with incompatible branch value types and receives a configuration type error. The relevant measured outcome is: terraform validate succeeds and both condition paths evaluate to the expected type.

D:

Validation resolves the child output and the value appears after successful creation. This evidence would validate a DIFFERENT correction: Add an explicit child output block and reference it through the module namespace from the root. That different correction addresses: A deployment consumes an output from a child module but forgets to declare the output in the module itself. It does not establish that the Evergreen Development issue has been corrected: An operator uses a conditional expression with incompatible branch value types and receives a configuration type error. The relevant measured outcome is: terraform validate succeeds and both condition paths evaluate to the expected type.

Question 417

Bluewater IT Services is preparing a controlled Terraform update after identifying this fault: A configuration needs a per-environment local constant reused across several resources but duplicates the entire calculation in every block. How should the Terraform engineer correct this specific failure?

  1. Define a local value derived from variables and reference local.<name> from the resources.
  2. Explain that Terraform declares desired manageable resources and reconciles them through provider APIs and tracked state.
  3. Review name uniqueness and lifecycle tradeoffs, choosing a safe migration or downtime approach instead of assuming create_before_destroy can always work.
  4. Inspect partial state and remote outcomes after a failed apply, then replan from the current condition.

Explanation

Correct Answer

A:

Define a local value derived from variables and reference local.<name> from the resources. This is targeted to the observed Terraform issue: A configuration needs a per-environment local constant reused across several resources but duplicates the entire calculation in every block. At Bluewater IT Services, the acceptance criterion is not merely a valid plan; the team should verify: A changed environment input updates all calculated uses consistently without repeated expressions.

Incorrect Answers

B:

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 Bluewater IT Services failure: A configuration needs a per-environment local constant reused across several resources but duplicates the entire calculation in every block. The required acceptance evidence instead is: A changed environment input updates all calculated uses consistently without repeated expressions.

C:

Review name uniqueness and lifecycle tradeoffs, choosing a safe migration or downtime approach instead of assuming create_before_destroy can always work. This would be suitable for a DIFFERENT Terraform problem: A service's immutable globally unique name prevents simultaneous duplicate instances, but engineers enable create_before_destroy without checking constraints. It does not directly resolve the Bluewater IT Services failure: A configuration needs a per-environment local constant reused across several resources but duplicates the entire calculation in every block. The required acceptance evidence instead is: A changed environment input updates all calculated uses consistently without repeated expressions.

D:

Inspect partial state and remote outcomes after a failed apply, then replan from the current condition. This would be suitable for a DIFFERENT Terraform problem: A release script assumes an unsuccessful Terraform apply leaves no infrastructure changes and deletes the incident log. It does not directly resolve the Bluewater IT Services failure: A configuration needs a per-environment local constant reused across several resources but duplicates the entire calculation in every block. The required acceptance evidence instead is: A changed environment input updates all calculated uses consistently without repeated expressions.

Question 418

Bluewater IT Services requires independent evidence before signing off this Terraform correction: A configuration needs a per-environment local constant reused across several resources but duplicates the entire calculation in every block. Which verification outcome is the strongest evidence of the required correction?

  1. The follow-up plan accounts for any already-created resources rather than attempting blind duplicate creation.
  2. A changed environment input updates all calculated uses consistently without repeated expressions.
  3. A no-change review leaves existing managed resources in place while detecting only an intentionally altered configuration field.
  4. A controlled replacement plan honors actual uniqueness constraints without failing on an unavoidable duplicate name.

Explanation

Correct Answer

B:

A changed environment input updates all calculated uses consistently without repeated expressions. This directly verifies the corrective action: Define a local value derived from variables and reference local.<name> from the resources. The measured result specifically addresses the failure at Bluewater IT Services: A configuration needs a per-environment local constant reused across several resources but duplicates the entire calculation in every block.

Incorrect Answers

A:

The follow-up plan accounts for any already-created resources rather than attempting blind duplicate creation. This evidence would validate a DIFFERENT correction: Inspect partial state and remote outcomes after a failed apply, then replan from the current condition. That different correction addresses: A release script assumes an unsuccessful Terraform apply leaves no infrastructure changes and deletes the incident log. It does not establish that the Bluewater IT Services issue has been corrected: A configuration needs a per-environment local constant reused across several resources but duplicates the entire calculation in every block. The relevant measured outcome is: A changed environment input updates all calculated uses consistently without repeated expressions.

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 Bluewater IT Services issue has been corrected: A configuration needs a per-environment local constant reused across several resources but duplicates the entire calculation in every block. The relevant measured outcome is: A changed environment input updates all calculated uses consistently without repeated expressions.

D:

A controlled replacement plan honors actual uniqueness constraints without failing on an unavoidable duplicate name. This evidence would validate a DIFFERENT correction: Review name uniqueness and lifecycle tradeoffs, choosing a safe migration or downtime approach instead of assuming create_before_destroy can always work. That different correction addresses: A service's immutable globally unique name prevents simultaneous duplicate instances, but engineers enable create_before_destroy without checking constraints. It does not establish that the Bluewater IT Services issue has been corrected: A configuration needs a per-environment local constant reused across several resources but duplicates the entire calculation in every block. The relevant measured outcome is: A changed environment input updates all calculated uses consistently without repeated expressions.

Question 419

A Terraform maintainer supporting Mariner Infrastructure Group investigates this scenario: A configuration needs a per-environment local constant reused across several resources but duplicates the entire calculation in every block. What is the most appropriate corrective action for this Terraform scenario?

  1. Pass provider configurations from the caller and avoid nested provider configuration in reusable child modules where possible.
  2. Separate ordering controls from lifecycle replacement behavior and verify whether create_before_destroy is valid for the provider.
  3. Define a local value derived from variables and reference local.<name> from the resources.
  4. Correct the mapping using supported state move/removal and import tooling after taking backups.

Explanation

Correct Answer

C:

Define a local value derived from variables and reference local.<name> from the resources. This is targeted to the observed Terraform issue: A configuration needs a per-environment local constant reused across several resources but duplicates the entire calculation in every block. At Mariner Infrastructure Group, the acceptance criterion is not merely a valid plan; the team should verify: A changed environment input updates all calculated uses consistently without repeated expressions.

Incorrect Answers

A:

Pass provider configurations from the caller and avoid nested provider configuration in reusable child modules where possible. This would be suitable for a DIFFERENT Terraform problem: An application module quietly configures an independent provider account, conflicting with the root's deployment credentials. It does not directly resolve the Mariner Infrastructure Group failure: A configuration needs a per-environment local constant reused across several resources but duplicates the entire calculation in every block. The required acceptance evidence instead is: A changed environment input updates all calculated uses consistently without repeated expressions.

B:

Separate ordering controls from lifecycle replacement behavior and verify whether create_before_destroy is valid for the provider. This would be suitable for a DIFFERENT Terraform problem: A resource is being replaced because a required argument changed, but a reviewer assumes depends_on alone forces zero-downtime recreation. It does not directly resolve the Mariner Infrastructure Group failure: A configuration needs a per-environment local constant reused across several resources but duplicates the entire calculation in every block. The required acceptance evidence instead is: A changed environment input updates all calculated uses consistently without repeated expressions.

D:

Correct the mapping using supported state move/removal and import tooling after taking backups. This would be suitable for a DIFFERENT Terraform problem: An engineer imports a shared resource to the wrong address and then manually edits terraform.tfstate with a text editor. It does not directly resolve the Mariner Infrastructure Group failure: A configuration needs a per-environment local constant reused across several resources but duplicates the entire calculation in every block. The required acceptance evidence instead is: A changed environment input updates all calculated uses consistently without repeated expressions.

Question 420

A controlled test for Mariner Infrastructure Group focuses on the original failure: A configuration needs a per-environment local constant reused across several resources but duplicates the entire calculation in every block. Which controlled check would validate the remediation?

  1. The module's resources resolve the caller-approved account and no unexpected credentials are used.
  2. The state list and inspected resource ID match the intended new address without unplanned object deletion.
  3. A planned replacement shows the chosen replacement sequence rather than claiming depends_on alters lifecycle order.
  4. A changed environment input updates all calculated uses consistently without repeated expressions.

Explanation

Correct Answer

D:

A changed environment input updates all calculated uses consistently without repeated expressions. This directly verifies the corrective action: Define a local value derived from variables and reference local.<name> from the resources. The measured result specifically addresses the failure at Mariner Infrastructure Group: A configuration needs a per-environment local constant reused across several resources but duplicates the entire calculation in every block.

Incorrect Answers

A:

The module's resources resolve the caller-approved account and no unexpected credentials are used. This evidence would validate a DIFFERENT correction: Pass provider configurations from the caller and avoid nested provider configuration in reusable child modules where possible. That different correction addresses: An application module quietly configures an independent provider account, conflicting with the root's deployment credentials. It does not establish that the Mariner Infrastructure Group issue has been corrected: A configuration needs a per-environment local constant reused across several resources but duplicates the entire calculation in every block. The relevant measured outcome is: A changed environment input updates all calculated uses consistently without repeated expressions.

B:

The state list and inspected resource ID match the intended new address without unplanned object deletion. This evidence would validate a DIFFERENT correction: Correct the mapping using supported state move/removal and import tooling after taking backups. That different correction addresses: An engineer imports a shared resource to the wrong address and then manually edits terraform.tfstate with a text editor. It does not establish that the Mariner Infrastructure Group issue has been corrected: A configuration needs a per-environment local constant reused across several resources but duplicates the entire calculation in every block. The relevant measured outcome is: A changed environment input updates all calculated uses consistently without repeated expressions.

C:

A planned replacement shows the chosen replacement sequence rather than claiming depends_on alters lifecycle order. This evidence would validate a DIFFERENT correction: Separate ordering controls from lifecycle replacement behavior and verify whether create_before_destroy is valid for the provider. That different correction addresses: A resource is being replaced because a required argument changed, but a reviewer assumes depends_on alone forces zero-downtime recreation. It does not establish that the Mariner Infrastructure Group issue has been corrected: A configuration needs a per-environment local constant reused across several resources but duplicates the entire calculation in every block. The relevant measured outcome is: A changed environment input updates all calculated uses consistently without repeated expressions.