Skip to content

Commit 0ba0294

Browse files
committed
Add the final touch
1 parent 68b9ad9 commit 0ba0294

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

website/docs/language/test-and-validate/validate.mdx

+3-4
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ resource "aws_instance" "example" {
9595

9696
The precondition detects if the caller accidentally selected an AMI for a different architecture, which may not be able to run the software this instance hosts. Terraform evaluates the precondition while it builds its plan, and if the precondition fails Terraform throws an error with the `error_message` argument and stops the current operation. Refer to the [resource configuration reference](/terraform/language/block/resource) for more examples of using a precondition block.
9797

98-
An `output` block can also include a precondition to verify a module's output. You can use preconditions on outputs to prevent Terraform from saving an invalid value in your state, or to preserve a valid value from the previous apply.
98+
An `output` block can also include a precondition to verify a module's output. Use preconditions on outputs to validate that your output values meets your requirements before Terraform exposes them or stores their values in state.
9999

100100
For example, you can use a precondition to ensure a server's security group has at least one ingress rule to allow traffic on ports `80` or `443`:
101101

@@ -198,7 +198,6 @@ Terraform validates different aspects of your configuration as early as it can.
198198
1. Terraform executes postconditions after planning and applying changes.
199199
1. Terraform executes checks at the end of plan and apply operations and every time health assessments run on a workspace in HCP Terraform.
200200

201-
202201
![Order of operations for when validations run](/img/docs/validation-order-of-operations-dark.jpg#light-theme-only)
203202

204203
![Order of operations for when validations run](/img/docs/validation-order-of-operations-dark.jpg#dark-theme-only)
@@ -242,5 +241,5 @@ To learn more about the conditions you can use in validations, refer to [Conditi
242241
## Next steps
243242

244243
Validating your configuration is the first step to mitigating risk in your infrastructure. Refer to the following topics for additional information about mitigating risk in your infrastructure lifecycle:
245-
- [Tests](/terraform/language/tests) help authors validate that module configuration updates do not introduce breaking changes.
246-
- [Policy features](/terraform/cloud-docs/policy-enforcement) in HCP Terraform enforce compliance with your organization's security rules and best practices when running Terraform plans.
244+
- [Tests](/terraform/language/tests) help authors validate that module configuration updates do not introduce breaking changes.
245+
- [Policy features](/terraform/cloud-docs/policy-enforcement) in HCP Terraform enforce compliance with your organization's security rules and best practices when running Terraform plans.

0 commit comments

Comments
 (0)