HashiCorp Terraform Associate Practice Test 46
Question 450
A team marks a critical storage container with prevent_destroy and assumes it cannot ever be deleted through the provider console or if the resource block is removed. The team has implemented an approved Terraform change. Which observed result most directly confirms that the original requirement is now met, beyond a successful command exit code?
- Terraform blocks unapproved destruction while separate platform controls guard the live object.
- Downstream automation receives only the documented subnet identifier.
- The module outputs a consistent address list matching selected instances.
- The resource exists once with the correct optional logging configuration.
Explanation
Correct Answer
A:This is the appropriate measurable post-change acceptance criterion: Terraform blocks unapproved destruction while separate platform controls guard the live object. A successful Terraform command or a completed change request alone would not demonstrate that outcome. Preserve this control during validation: Use provider safeguards and backups in addition to plan checks.
Incorrect Answers
B:“Downstream automation receives only the documented subnet identifier” would address a different Terraform configuration concern; the source instead describes A team marks a critical storage container with prevent_destroy and assumes it cannot ever be deleted through the provider console or if the resource block is removed. The appropriate design is to understand prevent_destroy as a Terraform planning guard only while the lifecycle rule remains in configuration. Confirm whether terraform blocks unapproved destruction while separate platform controls guard the live object.
C:“The module outputs a consistent address list matching selected instances” would address a different Terraform configuration concern; the source instead describes A team marks a critical storage container with prevent_destroy and assumes it cannot ever be deleted through the provider console or if the resource block is removed. The appropriate design is to understand prevent_destroy as a Terraform planning guard only while the lifecycle rule remains in configuration. Confirm whether terraform blocks unapproved destruction while separate platform controls guard the live object.
D:“The resource exists once with the correct optional logging configuration” would address a different Terraform configuration concern; the source instead describes A team marks a critical storage container with prevent_destroy and assumes it cannot ever be deleted through the provider console or if the resource block is removed. The appropriate design is to understand prevent_destroy as a Terraform planning guard only while the lifecycle rule remains in configuration. Confirm whether terraform blocks unapproved destruction while separate platform controls guard the live object.
Question 451
A cloud autoscaler adjusts the desired node count overnight, and Terraform repeatedly plans to reset it during unrelated tag changes. The infrastructure review requires a supported, least-disruptive Terraform solution. Which proposed change most directly addresses this specific situation?
- Use a suitable postcondition on the relevant managed value to verify the resulting attribute.
- Use a resource or data-source precondition where appropriate to enforce the required operational invariant.
- Use narrowly scoped ignore_changes for the externally controlled count while still tracking required security attributes.
- Declare an explicit root output for the required subnet ID and consume that supported interface.
Explanation
Correct Answer
C:The proposed intervention addresses the reported Terraform engineering failure: A cloud autoscaler adjusts the desired node count overnight, and Terraform repeatedly plans to reset it during unrelated tag changes. It applies the design choice Use narrowly scoped ignore_changes for the externally controlled count while still tracking required security attributes. Review the primary diagnostic: Inspect which attribute is modified by the autoscaler. The expected outcome is: Terraform stops fighting authorized scaling without ignoring security-critical drift. The rollout safeguard is: Document ownership and avoid ignoring all attributes unnecessarily.
Incorrect Answers
A:“Use a suitable postcondition on the relevant managed value to verify the resulting attribute” would address a different Terraform configuration concern; the source instead describes A cloud autoscaler adjusts the desired node count overnight, and Terraform repeatedly plans to reset it during unrelated tag changes. The appropriate design is to use narrowly scoped ignore_changes for the externally controlled count while still tracking required security attributes. Confirm whether terraform stops fighting authorized scaling without ignoring security-critical drift.
B:“Use a resource or data-source precondition where appropriate to enforce the required operational invariant” would address a different Terraform configuration concern; the source instead describes A cloud autoscaler adjusts the desired node count overnight, and Terraform repeatedly plans to reset it during unrelated tag changes. The appropriate design is to use narrowly scoped ignore_changes for the externally controlled count while still tracking required security attributes. Confirm whether terraform stops fighting authorized scaling without ignoring security-critical drift.
D:“Declare an explicit root output for the required subnet ID and consume that supported interface” would address a different Terraform configuration concern; the source instead describes A cloud autoscaler adjusts the desired node count overnight, and Terraform repeatedly plans to reset it during unrelated tag changes. The appropriate design is to use narrowly scoped ignore_changes for the externally controlled count while still tracking required security attributes. Confirm whether terraform stops fighting authorized scaling without ignoring security-critical drift.
Question 452
A cloud autoscaler adjusts the desired node count overnight, and Terraform repeatedly plans to reset it during unrelated tag changes. Before choosing a remedy, the team needs independent evidence of the actual root cause. Which TWO checks most directly test this case? (Select TWO.)
- Review the planned diff before and after the proposed lifecycle rule.
- Inspect variable ephemeral marking and actual consuming arguments.
- Inspect actual state content and variable consumer contexts.
- Inspect which attribute is modified by the autoscaler.
- Inspect the input map and expected output collection shape.
Explanation
Correct Answers
A:This is directly relevant evidence for the reported behavior: Review the planned diff before and after the proposed lifecycle rule. Pair it with a separate check from the same case rather than assuming one finding proves the cause. The evidence supports or refutes the change proposal: Use narrowly scoped ignore_changes for the externally controlled count while still tracking required security attributes. The expected confirmation is Terraform stops fighting authorized scaling without ignoring security-critical drift.
D:This is directly relevant evidence for the reported behavior: Inspect which attribute is modified by the autoscaler. Pair it with a separate check from the same case rather than assuming one finding proves the cause. The evidence supports or refutes the change proposal: Use narrowly scoped ignore_changes for the externally controlled count while still tracking required security attributes. The expected confirmation is Terraform stops fighting authorized scaling without ignoring security-critical drift.
Incorrect Answers
B:“Inspect variable ephemeral marking and actual consuming arguments” would address a different Terraform configuration concern; the source instead describes A cloud autoscaler adjusts the desired node count overnight, and Terraform repeatedly plans to reset it during unrelated tag changes. The appropriate design is to use narrowly scoped ignore_changes for the externally controlled count while still tracking required security attributes. Confirm whether terraform stops fighting authorized scaling without ignoring security-critical drift.
C:“Inspect actual state content and variable consumer contexts” would address a different Terraform configuration concern; the source instead describes A cloud autoscaler adjusts the desired node count overnight, and Terraform repeatedly plans to reset it during unrelated tag changes. The appropriate design is to use narrowly scoped ignore_changes for the externally controlled count while still tracking required security attributes. Confirm whether terraform stops fighting authorized scaling without ignoring security-critical drift.
E:“Inspect the input map and expected output collection shape” would address a different Terraform configuration concern; the source instead describes A cloud autoscaler adjusts the desired node count overnight, and Terraform repeatedly plans to reset it during unrelated tag changes. The appropriate design is to use narrowly scoped ignore_changes for the externally controlled count while still tracking required security attributes. Confirm whether terraform stops fighting authorized scaling without ignoring security-critical drift.
Question 453
A cloud autoscaler adjusts the desired node count overnight, and Terraform repeatedly plans to reset it during unrelated tag changes. If this behavior continues without correction, which specific risk is most closely supported by the facts, without assuming harm has already occurred?
- A lifecycle rule is not a comprehensive cloud deletion protection.
- Catching every error can conceal configuration mistakes.
- Manual address copying can create stale rules after replacement.
- Broad ignore_changes can hide important configuration drift.
Explanation
Correct Answer
D:The reported condition creates the specific potential exposure: Broad ignore_changes can hide important configuration drift. A risk is not evidence that every adverse outcome already occurred. Two independent checks can corroborate the assessment. First diagnostic: Inspect which attribute is modified by the autoscaler. Second diagnostic: Review the planned diff before and after the proposed lifecycle rule.
Incorrect Answers
A:“A lifecycle rule is not a comprehensive cloud deletion protection” would address a different Terraform configuration concern; the source instead describes A cloud autoscaler adjusts the desired node count overnight, and Terraform repeatedly plans to reset it during unrelated tag changes. The appropriate design is to use narrowly scoped ignore_changes for the externally controlled count while still tracking required security attributes. Confirm whether terraform stops fighting authorized scaling without ignoring security-critical drift.
B:“Catching every error can conceal configuration mistakes” would address a different Terraform configuration concern; the source instead describes A cloud autoscaler adjusts the desired node count overnight, and Terraform repeatedly plans to reset it during unrelated tag changes. The appropriate design is to use narrowly scoped ignore_changes for the externally controlled count while still tracking required security attributes. Confirm whether terraform stops fighting authorized scaling without ignoring security-critical drift.
C:“Manual address copying can create stale rules after replacement” would address a different Terraform configuration concern; the source instead describes A cloud autoscaler adjusts the desired node count overnight, and Terraform repeatedly plans to reset it during unrelated tag changes. The appropriate design is to use narrowly scoped ignore_changes for the externally controlled count while still tracking required security attributes. Confirm whether terraform stops fighting authorized scaling without ignoring security-critical drift.
Question 454
A cloud autoscaler adjusts the desired node count overnight, and Terraform repeatedly plans to reset it during unrelated tag changes. A reviewer asks for BOTH a targeted technical response and a corresponding change-control safeguard. Which TWO actions together meet that requirement? (Select TWO.)
- Test name strategy and dependent references before apply.
- Declare the value ephemeral and consume it only in permitted contexts, rather than persisting it in an ordinary output or resource attribute.
- Review naming constraints and avoid using locals for secrets storage.
- Document ownership and avoid ignoring all attributes unnecessarily.
- Use narrowly scoped ignore_changes for the externally controlled count while still tracking required security attributes.
Explanation
Correct Answers
D:This is one of the two necessary decisions for a safe design: Document ownership and avoid ignoring all attributes unnecessarily. Together the corrective action and its implementation safeguard need to address the recorded condition: A cloud autoscaler adjusts the desired node count overnight, and Terraform repeatedly plans to reset it during unrelated tag changes. Acceptance requires Terraform stops fighting authorized scaling without ignoring security-critical drift.
E:This is one of the two necessary decisions for a safe design: Use narrowly scoped ignore_changes for the externally controlled count while still tracking required security attributes. Together the corrective action and its implementation safeguard need to address the recorded condition: A cloud autoscaler adjusts the desired node count overnight, and Terraform repeatedly plans to reset it during unrelated tag changes. Acceptance requires Terraform stops fighting authorized scaling without ignoring security-critical drift.
Incorrect Answers
A:“Test name strategy and dependent references before apply” would address a different Terraform configuration concern; the source instead describes A cloud autoscaler adjusts the desired node count overnight, and Terraform repeatedly plans to reset it during unrelated tag changes. The appropriate design is to use narrowly scoped ignore_changes for the externally controlled count while still tracking required security attributes. Confirm whether terraform stops fighting authorized scaling without ignoring security-critical drift.
B:“Declare the value ephemeral and consume it only in permitted contexts, rather than persisting it in an ordinary output or resource attribute” would address a different Terraform configuration concern; the source instead describes A cloud autoscaler adjusts the desired node count overnight, and Terraform repeatedly plans to reset it during unrelated tag changes. The appropriate design is to use narrowly scoped ignore_changes for the externally controlled count while still tracking required security attributes. Confirm whether terraform stops fighting authorized scaling without ignoring security-critical drift.
C:“Review naming constraints and avoid using locals for secrets storage” would address a different Terraform configuration concern; the source instead describes A cloud autoscaler adjusts the desired node count overnight, and Terraform repeatedly plans to reset it during unrelated tag changes. The appropriate design is to use narrowly scoped ignore_changes for the externally controlled count while still tracking required security attributes. Confirm whether terraform stops fighting authorized scaling without ignoring security-critical drift.
Question 455
A cloud autoscaler adjusts the desired node count overnight, and Terraform repeatedly plans to reset it during unrelated tag changes. The team has implemented an approved Terraform change. Which observed result most directly confirms that the original requirement is now met, beyond a successful command exit code?
- The monitor is created after its required registration while unrelated actions remain parallel.
- The firewall rule follows the allocated address without hardcoded temporary values.
- The resource exists once with the correct optional logging configuration.
- Terraform stops fighting authorized scaling without ignoring security-critical drift.
Explanation
Correct Answer
D:This is the appropriate measurable post-change acceptance criterion: Terraform stops fighting authorized scaling without ignoring security-critical drift. A successful Terraform command or a completed change request alone would not demonstrate that outcome. Preserve this control during validation: Document ownership and avoid ignoring all attributes unnecessarily.
Incorrect Answers
A:“The monitor is created after its required registration while unrelated actions remain parallel” would address a different Terraform configuration concern; the source instead describes A cloud autoscaler adjusts the desired node count overnight, and Terraform repeatedly plans to reset it during unrelated tag changes. The appropriate design is to use narrowly scoped ignore_changes for the externally controlled count while still tracking required security attributes. Confirm whether terraform stops fighting authorized scaling without ignoring security-critical drift.
B:“The firewall rule follows the allocated address without hardcoded temporary values” would address a different Terraform configuration concern; the source instead describes A cloud autoscaler adjusts the desired node count overnight, and Terraform repeatedly plans to reset it during unrelated tag changes. The appropriate design is to use narrowly scoped ignore_changes for the externally controlled count while still tracking required security attributes. Confirm whether terraform stops fighting authorized scaling without ignoring security-critical drift.
C:“The resource exists once with the correct optional logging configuration” would address a different Terraform configuration concern; the source instead describes A cloud autoscaler adjusts the desired node count overnight, and Terraform repeatedly plans to reset it during unrelated tag changes. The appropriate design is to use narrowly scoped ignore_changes for the externally controlled count while still tracking required security attributes. Confirm whether terraform stops fighting authorized scaling without ignoring security-critical drift.
Question 456
A service requires a storage path to start with an approved prefix, but the configuration accepts arbitrary names because input validation is absent. The infrastructure review requires a supported, least-disruptive Terraform solution. Which proposed change most directly addresses this specific situation?
- Use an authorized Vault integration or credential injection design with short-lived scope, avoiding unnecessary state persistence.
- Add a variable validation condition with a specific error message for the required name pattern.
- Use a conditional expression or conditional nested dynamic block where supported rather than duplicating managed resources.
- Use narrowly scoped ignore_changes for the externally controlled count while still tracking required security attributes.
Explanation
Correct Answer
B:The proposed intervention addresses the reported Terraform engineering failure: A service requires a storage path to start with an approved prefix, but the configuration accepts arbitrary names because input validation is absent. It applies the design choice Add a variable validation condition with a specific error message for the required name pattern. Review the primary diagnostic: Inspect the input value type and authorized naming rules. The expected outcome is: Invalid inputs fail before creating storage in disallowed namespaces. The rollout safeguard is: Keep validation limited to actual documented business requirements.
Incorrect Answers
A:“Use an authorized Vault integration or credential injection design with short-lived scope, avoiding unnecessary state persistence” would address a different Terraform configuration concern; the source instead describes A service requires a storage path to start with an approved prefix, but the configuration accepts arbitrary names because input validation is absent. The appropriate design is to add a variable validation condition with a specific error message for the required name pattern. Confirm whether invalid inputs fail before creating storage in disallowed namespaces.
C:“Use a conditional expression or conditional nested dynamic block where supported rather than duplicating managed resources” would address a different Terraform configuration concern; the source instead describes A service requires a storage path to start with an approved prefix, but the configuration accepts arbitrary names because input validation is absent. The appropriate design is to add a variable validation condition with a specific error message for the required name pattern. Confirm whether invalid inputs fail before creating storage in disallowed namespaces.
D:“Use narrowly scoped ignore_changes for the externally controlled count while still tracking required security attributes” would address a different Terraform configuration concern; the source instead describes A service requires a storage path to start with an approved prefix, but the configuration accepts arbitrary names because input validation is absent. The appropriate design is to add a variable validation condition with a specific error message for the required name pattern. Confirm whether invalid inputs fail before creating storage in disallowed namespaces.
Question 457
A service requires a storage path to start with an approved prefix, but the configuration accepts arbitrary names because input validation is absent. Before choosing a remedy, the team needs independent evidence of the actual root cause. Which TWO checks most directly test this case? (Select TWO.)
- Inspect which map keys are required versus optional.
- Inspect provider schema for write-only support and documented version argument.
- Test the condition with a valid and invalid path.
- Inspect the input value type and authorized naming rules.
- Inspect the actual computed output and supported condition context.
Explanation
Correct Answers
C:This is directly relevant evidence for the reported behavior: Test the condition with a valid and invalid path. Pair it with a separate check from the same case rather than assuming one finding proves the cause. The evidence supports or refutes the change proposal: Add a variable validation condition with a specific error message for the required name pattern. The expected confirmation is Invalid inputs fail before creating storage in disallowed namespaces.
D:This is directly relevant evidence for the reported behavior: Inspect the input value type and authorized naming rules. Pair it with a separate check from the same case rather than assuming one finding proves the cause. The evidence supports or refutes the change proposal: Add a variable validation condition with a specific error message for the required name pattern. The expected confirmation is Invalid inputs fail before creating storage in disallowed namespaces.
Incorrect Answers
A:“Inspect which map keys are required versus optional” would address a different Terraform configuration concern; the source instead describes A service requires a storage path to start with an approved prefix, but the configuration accepts arbitrary names because input validation is absent. The appropriate design is to add a variable validation condition with a specific error message for the required name pattern. Confirm whether invalid inputs fail before creating storage in disallowed namespaces.
B:“Inspect provider schema for write-only support and documented version argument” would address a different Terraform configuration concern; the source instead describes A service requires a storage path to start with an approved prefix, but the configuration accepts arbitrary names because input validation is absent. The appropriate design is to add a variable validation condition with a specific error message for the required name pattern. Confirm whether invalid inputs fail before creating storage in disallowed namespaces.
E:“Inspect the actual computed output and supported condition context” would address a different Terraform configuration concern; the source instead describes A service requires a storage path to start with an approved prefix, but the configuration accepts arbitrary names because input validation is absent. The appropriate design is to add a variable validation condition with a specific error message for the required name pattern. Confirm whether invalid inputs fail before creating storage in disallowed namespaces.
Question 458
A service requires a storage path to start with an approved prefix, but the configuration accepts arbitrary names because input validation is absent. If this behavior continues without correction, which specific risk is most closely supported by the facts, without assuming harm has already occurred?
- Variable scopes do not automatically propagate through module boundaries.
- Unchecked user inputs can violate separation and naming policy.
- Sensitive flags alone do not prevent secret persistence in state.
- A missing guard can send traffic to an unintended network.
Explanation
Correct Answer
B:The reported condition creates the specific potential exposure: Unchecked user inputs can violate separation and naming policy. A risk is not evidence that every adverse outcome already occurred. Two independent checks can corroborate the assessment. First diagnostic: Inspect the input value type and authorized naming rules. Second diagnostic: Test the condition with a valid and invalid path.
Incorrect Answers
A:“Variable scopes do not automatically propagate through module boundaries” would address a different Terraform configuration concern; the source instead describes A service requires a storage path to start with an approved prefix, but the configuration accepts arbitrary names because input validation is absent. The appropriate design is to add a variable validation condition with a specific error message for the required name pattern. Confirm whether invalid inputs fail before creating storage in disallowed namespaces.
C:“Sensitive flags alone do not prevent secret persistence in state” would address a different Terraform configuration concern; the source instead describes A service requires a storage path to start with an approved prefix, but the configuration accepts arbitrary names because input validation is absent. The appropriate design is to add a variable validation condition with a specific error message for the required name pattern. Confirm whether invalid inputs fail before creating storage in disallowed namespaces.
D:“A missing guard can send traffic to an unintended network” would address a different Terraform configuration concern; the source instead describes A service requires a storage path to start with an approved prefix, but the configuration accepts arbitrary names because input validation is absent. The appropriate design is to add a variable validation condition with a specific error message for the required name pattern. Confirm whether invalid inputs fail before creating storage in disallowed namespaces.
Question 459
A service requires a storage path to start with an approved prefix, but the configuration accepts arbitrary names because input validation is absent. A reviewer asks for BOTH a targeted technical response and a corresponding change-control safeguard. Which TWO actions together meet that requirement? (Select TWO.)
- Add a variable validation condition with a specific error message for the required name pattern.
- Verify Vault token lifecycle and any provider data-source state exposure.
- Keep validation limited to actual documented business requirements.
- Write a clear condition message and test unknown values.
- Declare the value ephemeral and consume it only in permitted contexts, rather than persisting it in an ordinary output or resource attribute.
Explanation
Correct Answers
A:This is one of the two necessary decisions for a safe design: Add a variable validation condition with a specific error message for the required name pattern. Together the corrective action and its implementation safeguard need to address the recorded condition: A service requires a storage path to start with an approved prefix, but the configuration accepts arbitrary names because input validation is absent. Acceptance requires Invalid inputs fail before creating storage in disallowed namespaces.
C:This is one of the two necessary decisions for a safe design: Keep validation limited to actual documented business requirements. Together the corrective action and its implementation safeguard need to address the recorded condition: A service requires a storage path to start with an approved prefix, but the configuration accepts arbitrary names because input validation is absent. Acceptance requires Invalid inputs fail before creating storage in disallowed namespaces.
Incorrect Answers
B:“Verify Vault token lifecycle and any provider data-source state exposure” would address a different Terraform configuration concern; the source instead describes A service requires a storage path to start with an approved prefix, but the configuration accepts arbitrary names because input validation is absent. The appropriate design is to add a variable validation condition with a specific error message for the required name pattern. Confirm whether invalid inputs fail before creating storage in disallowed namespaces.
D:“Write a clear condition message and test unknown values” would address a different Terraform configuration concern; the source instead describes A service requires a storage path to start with an approved prefix, but the configuration accepts arbitrary names because input validation is absent. The appropriate design is to add a variable validation condition with a specific error message for the required name pattern. Confirm whether invalid inputs fail before creating storage in disallowed namespaces.
E:“Declare the value ephemeral and consume it only in permitted contexts, rather than persisting it in an ordinary output or resource attribute” would address a different Terraform configuration concern; the source instead describes A service requires a storage path to start with an approved prefix, but the configuration accepts arbitrary names because input validation is absent. The appropriate design is to add a variable validation condition with a specific error message for the required name pattern. Confirm whether invalid inputs fail before creating storage in disallowed namespaces.
Question 460
A service requires a storage path to start with an approved prefix, but the configuration accepts arbitrary names because input validation is absent. The team has implemented an approved Terraform change. Which observed result most directly confirms that the original requirement is now met, beyond a successful command exit code?
- Invalid inputs fail before creating storage in disallowed namespaces.
- The target credential is rotated without a plaintext password field saved in state.
- The firewall rule follows the allocated address without hardcoded temporary values.
- Terraform stops fighting authorized scaling without ignoring security-critical drift.
Explanation
Correct Answer
A:This is the appropriate measurable post-change acceptance criterion: Invalid inputs fail before creating storage in disallowed namespaces. A successful Terraform command or a completed change request alone would not demonstrate that outcome. Preserve this control during validation: Keep validation limited to actual documented business requirements.
Incorrect Answers
B:“The target credential is rotated without a plaintext password field saved in state” would address a different Terraform configuration concern; the source instead describes A service requires a storage path to start with an approved prefix, but the configuration accepts arbitrary names because input validation is absent. The appropriate design is to add a variable validation condition with a specific error message for the required name pattern. Confirm whether invalid inputs fail before creating storage in disallowed namespaces.
C:“The firewall rule follows the allocated address without hardcoded temporary values” would address a different Terraform configuration concern; the source instead describes A service requires a storage path to start with an approved prefix, but the configuration accepts arbitrary names because input validation is absent. The appropriate design is to add a variable validation condition with a specific error message for the required name pattern. Confirm whether invalid inputs fail before creating storage in disallowed namespaces.
D:“Terraform stops fighting authorized scaling without ignoring security-critical drift” would address a different Terraform configuration concern; the source instead describes A service requires a storage path to start with an approved prefix, but the configuration accepts arbitrary names because input validation is absent. The appropriate design is to add a variable validation condition with a specific error message for the required name pattern. Confirm whether invalid inputs fail before creating storage in disallowed namespaces.