You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
97
97
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.
99
99
100
100
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`:
101
101
@@ -198,7 +198,6 @@ Terraform validates different aspects of your configuration as early as it can.
198
198
1. Terraform executes postconditions after planning and applying changes.
199
199
1. Terraform executes checks at the end of plan and apply operations and every time health assessments run on a workspace in HCP Terraform.
200
200
201
-
202
201

203
202
204
203

@@ -242,5 +241,5 @@ To learn more about the conditions you can use in validations, refer to [Conditi
242
241
## Next steps
243
242
244
243
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