Skip to content

Commit

Permalink
Merge pull request #33441 from ctrombley/docs/checks-for-continuous-v…
Browse files Browse the repository at this point in the history
…alidation

docs: dissociate CV from preconditions and postconditions
  • Loading branch information
ritsok authored Jun 29, 2023
2 parents f2b34c5 + 6d81766 commit 76290e8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions website/docs/language/expressions/custom-conditions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,6 @@ Preconditions can serve a symmetrical purpose to input variable `validation` blo

Terraform evaluates output value preconditions before evaluating the `value` expression to finalize the result. Preconditions can take precedence over potential errors in the `value` expression.

### Continuous Validation in Terraform Cloud

Terraform Cloud can automatically check whether the preconditions and postconditions in a workspace’s configuration continue to pass after Terraform provisions the infrastructure. For example, you can write a `postcondition` to check whether an API gateway certificate is valid. Continuous validation alerts you when the condition fails, so you can update the certificate and avoid errors the next time you want to update your infrastructure. Refer to [Continuous Validation](/terraform/cloud-docs/workspaces/health#continuous-validation) in the Terraform Cloud documentation for details.

### Examples

The following example shows use cases for preconditions and postconditions. The preconditions and postconditions declare the following assumptions and guarantees.
Expand Down Expand Up @@ -238,6 +234,10 @@ check "health_check" {

If the condition evaluates to `false`, Terraform produces an [error message](#error-messages) that includes the result of the `error_message` expression. If you declare multiple assertions, Terraform returns error messages for all failed conditions.

### Continuous Validation in Terraform Cloud

Terraform Cloud can automatically check whether the checks in a workspace’s configuration continue to pass after Terraform provisions the infrastructure. For example, you can write a `check` to continuously monitor the validity of an API gateway certificate. Continuous validation alerts you when the condition fails, so you can update the certificate and avoid errors the next time you want to update your infrastructure. Refer to [Continuous Validation](/terraform/cloud-docs/workspaces/health#continuous-validation) in the Terraform Cloud documentation for details.

## Condition Expressions

Check assertions, input variable validation, preconditions, and postconditions all require a `condition` argument. This is a boolean expression that should return `true` if the intended assumption or guarantee is fulfilled or `false` if it does not.
Expand Down

0 comments on commit 76290e8

Please sign in to comment.