mcAfee Secure Website
23

HashiCorp Terraform Associate 004 Bundle

Exam Code: Terraform Associate 004

Exam Name HashiCorp Certified: Terraform Associate (004)

Certification Provider: HashiCorp

Corresponding Certification: Terraform Associate

Terraform Associate 004 Training Materials $44.99

Reliable & Actual Study Materials for Terraform Associate 004 Exam Success

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

  • 24
    Questions & Answers

    Terraform Associate 004 Questions & Answers

    167 Questions & Answers

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

  • 25
    Terraform Associate 004 Video Course

    Terraform Associate 004 Training Course

    118 Video Lectures

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

  • exam =30
    Study Guide

    Terraform Associate 004 Study Guide

    285 PDF Pages

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

exam =32

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

Guarantee

Satisfaction Guaranteed

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

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

Purchase Individually

  • exam =34
    Questions & Answers

    Questions & Answers

    167 Questions

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

    Training Course

    118 Video Lectures

    $39.99
  • exam =36
    Study Guide

    Study Guide

    285 PDF Pages

    $29.99

HashiCorp Terraform Associate 004 Practice Test 40

Question 390

A Terraform associate evaluates: A deployment requires a particular policy setup completed before a managed workload starts. Select TWO complementary responses: the appropriate action AND direct evidence it worked.

  1. Use lifecycle create_before_destroy for supported replacements requiring new capacity before old removal, while checking name uniqueness and provider constraints.
  2. The plan shows dependent resources using the produced attribute and schedules operations accordingly.
  3. Use depends_on only when a real ordering requirement is not represented by an attribute reference, after checking implicit dependencies first.
  4. Removing a middle entry from a count-indexed collection can shift addresses and provoke unintended replacements.
  5. The resource graph includes the required ordering without invented dependencies between unrelated resources.

Explanation

Correct Answers

C:

The case says: A deployment requires a particular policy setup completed before a managed workload starts. The directly relevant Terraform response is: Use depends_on only when a real ordering requirement is not represented by an attribute reference, after checking implicit dependencies first. This addresses the related failure mode: Terraform may not infer relationships that have no data reference, but excessive explicit dependencies can make plans unnecessarily conservative. Validate the result by checking: The resource graph includes the required ordering without invented dependencies between unrelated resources. The selection matches this objective, rather than a different Terraform administration task.

E:

The observed situation is: A deployment requires a particular policy setup completed before a managed workload starts. The acceptance evidence is: The resource graph includes the required ordering without invented dependencies between unrelated resources. It verifies the corrective approach (Use depends_on only when a real ordering requirement is not represented by an attribute reference, after checking implicit dependencies first.) and controls the risk: Terraform may not infer relationships that have no data reference, but excessive explicit dependencies can make plans unnecessarily conservative. Checking an unrelated Terraform setting would not prove the stated requirement was met.

Incorrect Answers

A:

Use lifecycle create_before_destroy for supported replacements requiring new capacity before old removal, while checking name uniqueness and provider constraints. This belongs to Lifecycle create_before_destroy (official objective 4f). Its separate risk is that a replacement may fail if a globally unique name prevents a second object from existing simultaneously. The question instead tests Explicit depends_on for hidden dependencies; that other safeguard alone does not verify it.

B:

The plan shows dependent resources using the produced attribute and schedules operations accordingly. This is relevant to Implicit dependency through attribute reference (official objective 4b). Its distinct failure risk is that hardcoding an anticipated ID bypasses Terraform's graph and can reference a stale or nonexistent object. The present question tests Explicit depends_on for hidden dependencies, which this measure alone does not establish.

D:

Removing a middle entry from a count-indexed collection can shift addresses and provoke unintended replacements. This addresses count versus for_each stable addressing (official objective 4e). The separate hazard is that removing a middle entry from a count-indexed collection can shift addresses and provoke unintended replacements. It does not by itself satisfy the case-specific requirement for Explicit depends_on for hidden dependencies.

Question 391

A Terraform engineer reports: A load balancer replacement should avoid dropping the old endpoint before the new one is ready. Which action BEST addresses the specific Terraform Associate (004) requirement?

  1. Declare typed input variables and supply different values through approved tfvars or other documented input mechanisms rather than editing module internals.
  2. Expose a child module's needed value as an output and reference it from the root through module.NAME.OUTPUT_NAME.
  3. Use depends_on only when a real ordering requirement is not represented by an attribute reference, after checking implicit dependencies first.
  4. Use lifecycle create_before_destroy for supported replacements requiring new capacity before old removal, while checking name uniqueness and provider constraints.

Explanation

Correct Answer

D:

The case says: A load balancer replacement should avoid dropping the old endpoint before the new one is ready. The directly relevant Terraform response is: Use lifecycle create_before_destroy for supported replacements requiring new capacity before old removal, while checking name uniqueness and provider constraints. This addresses the related failure mode: A replacement may fail if a globally unique name prevents a second object from existing simultaneously. Validate the result by checking: The replacement plan shows create-before-destroy ordering and a test confirms provider constraints permit both instances. The selection matches this objective, rather than a different Terraform administration task.

Incorrect Answers

A:

Declare typed input variables and supply different values through approved tfvars or other documented input mechanisms rather than editing module internals. This belongs to Input variables and default or CLI overrides (official objective 4c). Its separate risk is that hardcoded environment values in shared configuration create accidental cross-environment changes. The question instead tests Lifecycle create_before_destroy; that other safeguard alone does not verify it.

B:

Expose a child module's needed value as an output and reference it from the root through module.NAME.OUTPUT_NAME. This is relevant to Cross-module output references (official objective 4b). Its distinct failure risk is that trying to reach directly into a child module's private resource address bypasses the module interface. The present question tests Lifecycle create_before_destroy, which this measure alone does not establish.

C:

Use depends_on only when a real ordering requirement is not represented by an attribute reference, after checking implicit dependencies first. That addresses Explicit depends_on for hidden dependencies (official objective 4f), specifically the hazard that terraform may not infer relationships that have no data reference, but excessive explicit dependencies can make plans unnecessarily conservative. Here the necessary action or evidence is Use lifecycle create_before_destroy for supported replacements requiring new capacity before old removal, while checking name uniqueness and provider constraints, not that separate control.

Question 392

After a reviewed change, the team checks: A load balancer replacement should avoid dropping the old endpoint before the new one is ready. Which evidence MOST directly proves the selected approach is working?

  1. A purposely violated precondition blocks the operation while an independent check reports its observed condition as designed.
  2. The replacement plan shows create-before-destroy ordering and a test confirms provider constraints permit both instances.
  3. An invalid test input fails with the intended error while an approved value passes validation.
  4. The resource graph includes the required ordering without invented dependencies between unrelated resources.

Explanation

Correct Answer

B:

The observed situation is: A load balancer replacement should avoid dropping the old endpoint before the new one is ready. The acceptance evidence is: The replacement plan shows create-before-destroy ordering and a test confirms provider constraints permit both instances. It verifies the corrective approach (Use lifecycle create_before_destroy for supported replacements requiring new capacity before old removal, while checking name uniqueness and provider constraints.) and controls the risk: A replacement may fail if a globally unique name prevents a second object from existing simultaneously. Checking an unrelated Terraform setting would not prove the stated requirement was met.

Incorrect Answers

A:

A purposely violated precondition blocks the operation while an independent check reports its observed condition as designed. This belongs to Preconditions postconditions and checks (official objective 4g). Its separate risk is that confusing advisory checks with hard validation gates can let an unsafe value pass despite a warning. The question instead tests Lifecycle create_before_destroy; that other safeguard alone does not verify it.

C:

An invalid test input fails with the intended error while an approved value passes validation. That addresses Input variable validation rules (official objective 4g), specifically the hazard that malformed input values can drive unsupported sizes or unsafe configuration even when their basic types are valid. Here the necessary action or evidence is The replacement plan shows create-before-destroy ordering and a test confirms provider constraints permit both instances, not that separate control.

D:

The resource graph includes the required ordering without invented dependencies between unrelated resources. This addresses Explicit depends_on for hidden dependencies (official objective 4f). The separate hazard is that terraform may not infer relationships that have no data reference, but excessive explicit dependencies can make plans unnecessarily conservative. It does not by itself satisfy the case-specific requirement for Lifecycle create_before_destroy.

Question 393

A configuration review reveals: A cloud resource has a fixed globally unique name and create_before_destroy could conflict. Which action BEST addresses the specific Terraform Associate (004) requirement?

  1. Use lifecycle create_before_destroy for supported replacements requiring new capacity before old removal, while checking name uniqueness and provider constraints.
  2. Use a provider data source that matches a unique existing remote object and feed its returned attributes into managed resource arguments.
  3. Use object type constraints for named fields and tuple for fixed-position heterogeneous elements when modeling structured input variables.
  4. Use depends_on only when a real ordering requirement is not represented by an attribute reference, after checking implicit dependencies first.

Explanation

Correct Answer

A:

The case says: A cloud resource has a fixed globally unique name and create_before_destroy could conflict. The directly relevant Terraform response is: Use lifecycle create_before_destroy for supported replacements requiring new capacity before old removal, while checking name uniqueness and provider constraints. This addresses the related failure mode: A replacement may fail if a globally unique name prevents a second object from existing simultaneously. Validate the result by checking: The replacement plan shows create-before-destroy ordering and a test confirms provider constraints permit both instances. The selection matches this objective, rather than a different Terraform administration task.

Incorrect Answers

B:

Use a provider data source that matches a unique existing remote object and feed its returned attributes into managed resource arguments. This is relevant to Read-only data source lookup (official objective 4a). Its distinct failure risk is that an ambiguous or missing data-source match can fail planning or target the wrong existing resource. The present question tests Lifecycle create_before_destroy, which this measure alone does not establish.

C:

Use object type constraints for named fields and tuple for fixed-position heterogeneous elements when modeling structured input variables. That addresses Object and tuple structural types (official objective 4d), specifically the hazard that treating a structured object like an untyped string makes required fields and attribute access error-prone. Here the necessary action or evidence is Use lifecycle create_before_destroy for supported replacements requiring new capacity before old removal, while checking name uniqueness and provider constraints, not that separate control.

D:

Use depends_on only when a real ordering requirement is not represented by an attribute reference, after checking implicit dependencies first. This addresses Explicit depends_on for hidden dependencies (official objective 4f). The separate hazard is that terraform may not infer relationships that have no data reference, but excessive explicit dependencies can make plans unnecessarily conservative. It does not by itself satisfy the case-specific requirement for Lifecycle create_before_destroy.

Question 394

A Terraform governance audit identifies: A cloud resource has a fixed globally unique name and create_before_destroy could conflict. What risk MOST directly explains why a correction is needed?

  1. A replacement may fail if a globally unique name prevents a second object from existing simultaneously.
  2. Terraform may not infer relationships that have no data reference, but excessive explicit dependencies can make plans unnecessarily conservative.
  3. Treating a structured object like an untyped string makes required fields and attribute access error-prone.
  4. Hardcoded environment values in shared configuration create accidental cross-environment changes.

Explanation

Correct Answer

A:

The reported issue (A cloud resource has a fixed globally unique name and create_before_destroy could conflict) exposes the risk: A replacement may fail if a globally unique name prevents a second object from existing simultaneously. The corrective action is: Use lifecycle create_before_destroy for supported replacements requiring new capacity before old removal, while checking name uniqueness and provider constraints. Confirm with: The replacement plan shows create-before-destroy ordering and a test confirms provider constraints permit both instances. The risk is specific to this configuration or operation, not an unrelated Terraform feature.

Incorrect Answers

B:

Terraform may not infer relationships that have no data reference, but excessive explicit dependencies can make plans unnecessarily conservative. This is relevant to Explicit depends_on for hidden dependencies (official objective 4f). Its distinct failure risk is that terraform may not infer relationships that have no data reference, but excessive explicit dependencies can make plans unnecessarily conservative. The present question tests Lifecycle create_before_destroy, which this measure alone does not establish.

C:

Treating a structured object like an untyped string makes required fields and attribute access error-prone. That is the exact risk associated with Object and tuple structural types (official objective 4d), not the required Lifecycle create_before_destroy outcome.

D:

Hardcoded environment values in shared configuration create accidental cross-environment changes. This addresses Input variables and default or CLI overrides (official objective 4c). The separate hazard is that hardcoded environment values in shared configuration create accidental cross-environment changes. It does not by itself satisfy the case-specific requirement for Lifecycle create_before_destroy.

Question 395

During a controlled infrastructure change, a team observes: An engineer needs to change an immutable resource field with minimal downtime. Which action BEST addresses the specific Terraform Associate (004) requirement?

  1. Use sensitive to redact CLI display and ephemeral for supported temporary values that must be omitted from plan and state, respecting context restrictions.
  2. Use depends_on only when a real ordering requirement is not represented by an attribute reference, after checking implicit dependencies first.
  3. Use lifecycle create_before_destroy for supported replacements requiring new capacity before old removal, while checking name uniqueness and provider constraints.
  4. Use object type constraints for named fields and tuple for fixed-position heterogeneous elements when modeling structured input variables.

Explanation

Correct Answer

C:

The case says: An engineer needs to change an immutable resource field with minimal downtime. The directly relevant Terraform response is: Use lifecycle create_before_destroy for supported replacements requiring new capacity before old removal, while checking name uniqueness and provider constraints. This addresses the related failure mode: A replacement may fail if a globally unique name prevents a second object from existing simultaneously. Validate the result by checking: The replacement plan shows create-before-destroy ordering and a test confirms provider constraints permit both instances. The selection matches this objective, rather than a different Terraform administration task.

Incorrect Answers

A:

Use sensitive to redact CLI display and ephemeral for supported temporary values that must be omitted from plan and state, respecting context restrictions. This belongs to Sensitive variables versus ephemeral variables (official objective 4h). Its separate risk is that a secret can still appear in state despite sensitive=true and may require an ephemeral value path to avoid persistence. The question instead tests Lifecycle create_before_destroy; that other safeguard alone does not verify it.

B:

Use depends_on only when a real ordering requirement is not represented by an attribute reference, after checking implicit dependencies first. This is relevant to Explicit depends_on for hidden dependencies (official objective 4f). Its distinct failure risk is that terraform may not infer relationships that have no data reference, but excessive explicit dependencies can make plans unnecessarily conservative. The present question tests Lifecycle create_before_destroy, which this measure alone does not establish.

D:

Use object type constraints for named fields and tuple for fixed-position heterogeneous elements when modeling structured input variables. This addresses Object and tuple structural types (official objective 4d). The separate hazard is that treating a structured object like an untyped string makes required fields and attribute access error-prone. It does not by itself satisfy the case-specific requirement for Lifecycle create_before_destroy.

Question 396

An operator wants proof regarding: An engineer needs to change an immutable resource field with minimal downtime. Which evidence MOST directly proves the selected approach is working?

  1. The resource graph includes the required ordering without invented dependencies between unrelated resources.
  2. The replacement plan shows create-before-destroy ordering and a test confirms provider constraints permit both instances.
  3. The plan creates only declared managed resources while existing data-source objects are read and remain unmanaged.
  4. State and plan inspections confirm approved temporary credentials are omitted and ordinary sensitive outputs are redacted.

Explanation

Correct Answer

B:

The observed situation is: An engineer needs to change an immutable resource field with minimal downtime. The acceptance evidence is: The replacement plan shows create-before-destroy ordering and a test confirms provider constraints permit both instances. It verifies the corrective approach (Use lifecycle create_before_destroy for supported replacements requiring new capacity before old removal, while checking name uniqueness and provider constraints.) and controls the risk: A replacement may fail if a globally unique name prevents a second object from existing simultaneously. Checking an unrelated Terraform setting would not prove the stated requirement was met.

Incorrect Answers

A:

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

C:

The plan creates only declared managed resources while existing data-source objects are read and remain unmanaged. That addresses Managed resources versus data sources (official objective 4a), specifically the hazard that a data source query alone will not create or delete the referenced infrastructure object. Here the necessary action or evidence is The replacement plan shows create-before-destroy ordering and a test confirms provider constraints permit both instances, not that separate control.

D:

State and plan inspections confirm approved temporary credentials are omitted and ordinary sensitive outputs are redacted. This addresses Sensitive variables versus ephemeral variables (official objective 4h). The separate hazard is that a secret can still appear in state despite sensitive=true and may require an ephemeral value path to avoid persistence. It does not by itself satisfy the case-specific requirement for Lifecycle create_before_destroy.

Question 397

An infrastructure deployment design calls for: A policy adds lifecycle ordering but the provider disallows coexisting duplicate names. Which action BEST addresses the specific Terraform Associate (004) requirement?

  1. Expose a child module's needed value as an output and reference it from the root through module.NAME.OUTPUT_NAME.
  2. Pass secrets through provider-supported write-only arguments and appropriate Vault or ephemeral sources, checking provider versions and never logging values.
  3. Use lifecycle create_before_destroy for supported replacements requiring new capacity before old removal, while checking name uniqueness and provider constraints.
  4. Use depends_on only when a real ordering requirement is not represented by an attribute reference, after checking implicit dependencies first.

Explanation

Correct Answer

C:

The case says: A policy adds lifecycle ordering but the provider disallows coexisting duplicate names. The directly relevant Terraform response is: Use lifecycle create_before_destroy for supported replacements requiring new capacity before old removal, while checking name uniqueness and provider constraints. This addresses the related failure mode: A replacement may fail if a globally unique name prevents a second object from existing simultaneously. Validate the result by checking: The replacement plan shows create-before-destroy ordering and a test confirms provider constraints permit both instances. The selection matches this objective, rather than a different Terraform administration task.

Incorrect Answers

A:

Expose a child module's needed value as an output and reference it from the root through module.NAME.OUTPUT_NAME. This belongs to Cross-module output references (official objective 4b). Its separate risk is that trying to reach directly into a child module's private resource address bypasses the module interface. The question instead tests Lifecycle create_before_destroy; that other safeguard alone does not verify it.

B:

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

D:

Use depends_on only when a real ordering requirement is not represented by an attribute reference, after checking implicit dependencies first. This addresses Explicit depends_on for hidden dependencies (official objective 4f). The separate hazard is that terraform may not infer relationships that have no data reference, but excessive explicit dependencies can make plans unnecessarily conservative. It does not by itself satisfy the case-specific requirement for Lifecycle create_before_destroy.

Question 398

A production-readiness review highlights: A policy adds lifecycle ordering but the provider disallows coexisting duplicate names. What risk MOST directly explains why a correction is needed?

  1. Terraform may not infer relationships that have no data reference, but excessive explicit dependencies can make plans unnecessarily conservative.
  2. Malformed input values can drive unsupported sizes or unsafe configuration even when their basic types are valid.
  3. A replacement may fail if a globally unique name prevents a second object from existing simultaneously.
  4. Hardcoding an anticipated ID bypasses Terraform's graph and can reference a stale or nonexistent object.

Explanation

Correct Answer

C:

The reported issue (A policy adds lifecycle ordering but the provider disallows coexisting duplicate names) exposes the risk: A replacement may fail if a globally unique name prevents a second object from existing simultaneously. The corrective action is: Use lifecycle create_before_destroy for supported replacements requiring new capacity before old removal, while checking name uniqueness and provider constraints. Confirm with: The replacement plan shows create-before-destroy ordering and a test confirms provider constraints permit both instances. The risk is specific to this configuration or operation, not an unrelated Terraform feature.

Incorrect Answers

A:

Terraform may not infer relationships that have no data reference, but excessive explicit dependencies can make plans unnecessarily conservative. This belongs to Explicit depends_on for hidden dependencies (official objective 4f). Its separate risk is that terraform may not infer relationships that have no data reference, but excessive explicit dependencies can make plans unnecessarily conservative. The question instead tests Lifecycle create_before_destroy; that other safeguard alone does not verify it.

B:

Malformed input values can drive unsupported sizes or unsafe configuration even when their basic types are valid. This is relevant to Input variable validation rules (official objective 4g). Its distinct failure risk is that malformed input values can drive unsupported sizes or unsafe configuration even when their basic types are valid. The present question tests Lifecycle create_before_destroy, which this measure alone does not establish.

D:

Hardcoding an anticipated ID bypasses Terraform's graph and can reference a stale or nonexistent object. This addresses Implicit dependency through attribute reference (official objective 4b). The separate hazard is that hardcoding an anticipated ID bypasses Terraform's graph and can reference a stale or nonexistent object. It does not by itself satisfy the case-specific requirement for Lifecycle create_before_destroy.

Question 399

An operations team needs to resolve: A production review asks whether the planned replacement will create the new object before deleting the old. Which action BEST addresses the specific Terraform Associate (004) requirement?

  1. Use a variable validation block with a clear condition and error message to reject invalid caller inputs before changes are planned.
  2. Use depends_on only when a real ordering requirement is not represented by an attribute reference, after checking implicit dependencies first.
  3. Declare typed input variables and supply different values through approved tfvars or other documented input mechanisms rather than editing module internals.
  4. Use lifecycle create_before_destroy for supported replacements requiring new capacity before old removal, while checking name uniqueness and provider constraints.

Explanation

Correct Answer

D:

The case says: A production review asks whether the planned replacement will create the new object before deleting the old. The directly relevant Terraform response is: Use lifecycle create_before_destroy for supported replacements requiring new capacity before old removal, while checking name uniqueness and provider constraints. This addresses the related failure mode: A replacement may fail if a globally unique name prevents a second object from existing simultaneously. Validate the result by checking: The replacement plan shows create-before-destroy ordering and a test confirms provider constraints permit both instances. The selection matches this objective, rather than a different Terraform administration task.

Incorrect Answers

A:

Use a variable validation block with a clear condition and error message to reject invalid caller inputs before changes are planned. This belongs to Input variable validation rules (official objective 4g). Its separate risk is that malformed input values can drive unsupported sizes or unsafe configuration even when their basic types are valid. The question instead tests Lifecycle create_before_destroy; that other safeguard alone does not verify it.

B:

Use depends_on only when a real ordering requirement is not represented by an attribute reference, after checking implicit dependencies first. This is relevant to Explicit depends_on for hidden dependencies (official objective 4f). Its distinct failure risk is that terraform may not infer relationships that have no data reference, but excessive explicit dependencies can make plans unnecessarily conservative. The present question tests Lifecycle create_before_destroy, which this measure alone does not establish.

C:

Declare typed input variables and supply different values through approved tfvars or other documented input mechanisms rather than editing module internals. That addresses Input variables and default or CLI overrides (official objective 4c), specifically the hazard that hardcoded environment values in shared configuration create accidental cross-environment changes. Here the necessary action or evidence is Use lifecycle create_before_destroy for supported replacements requiring new capacity before old removal, while checking name uniqueness and provider constraints, not that separate control.

Question 400

A Terraform associate evaluates: A production review asks whether the planned replacement will create the new object before deleting the old. Select TWO complementary responses: the appropriate action AND direct evidence it worked.

  1. A data source query alone will not create or delete the referenced infrastructure object.
  2. A plan shows the intended input values for the selected environment and variable validation accepts them.
  3. Use depends_on only when a real ordering requirement is not represented by an attribute reference, after checking implicit dependencies first.
  4. The replacement plan shows create-before-destroy ordering and a test confirms provider constraints permit both instances.
  5. Use lifecycle create_before_destroy for supported replacements requiring new capacity before old removal, while checking name uniqueness and provider constraints.

Explanation

Correct Answers

D:

The observed situation is: A production review asks whether the planned replacement will create the new object before deleting the old. The acceptance evidence is: The replacement plan shows create-before-destroy ordering and a test confirms provider constraints permit both instances. It verifies the corrective approach (Use lifecycle create_before_destroy for supported replacements requiring new capacity before old removal, while checking name uniqueness and provider constraints.) and controls the risk: A replacement may fail if a globally unique name prevents a second object from existing simultaneously. Checking an unrelated Terraform setting would not prove the stated requirement was met.

E:

The case says: A production review asks whether the planned replacement will create the new object before deleting the old. The directly relevant Terraform response is: Use lifecycle create_before_destroy for supported replacements requiring new capacity before old removal, while checking name uniqueness and provider constraints. This addresses the related failure mode: A replacement may fail if a globally unique name prevents a second object from existing simultaneously. Validate the result by checking: The replacement plan shows create-before-destroy ordering and a test confirms provider constraints permit both instances. The selection matches this objective, rather than a different Terraform administration task.

Incorrect Answers

A:

A data source query alone will not create or delete the referenced infrastructure object. This belongs to Managed resources versus data sources (official objective 4a). Its separate risk is that a data source query alone will not create or delete the referenced infrastructure object. The question instead tests Lifecycle create_before_destroy; that other safeguard alone does not verify it.

B:

A plan shows the intended input values for the selected environment and variable validation accepts them. This is relevant to Input variables and default or CLI overrides (official objective 4c). Its distinct failure risk is that hardcoded environment values in shared configuration create accidental cross-environment changes. The present question tests Lifecycle create_before_destroy, which this measure alone does not establish.

C:

Use depends_on only when a real ordering requirement is not represented by an attribute reference, after checking implicit dependencies first. That addresses Explicit depends_on for hidden dependencies (official objective 4f), specifically the hazard that terraform may not infer relationships that have no data reference, but excessive explicit dependencies can make plans unnecessarily conservative. Here the necessary action or evidence is the paired action The replacement plan shows create-before-destroy ordering and a test confirms provider constraints permit both instances and separate validation Use lifecycle create_before_destroy for supported replacements requiring new capacity before old removal, while checking name uniqueness and provider constraints, not that separate control.