# Value Validation

Nobody enjoys typos, especially ones that make their way into production and cause outages. With CloudTruth you can set a series of rules and typing on your parameters to ensure they meet a specific criteria, or syntax, that meet specific intended values.

## Creating Parameter Rules

Rules are set on the parameter itself within a selected project that provide validation of values across all of the parameters environments.

The following are the current rules you can set on your parameters.

| Parameter Type | Allowed Rules                                                       |
| -------------- | ------------------------------------------------------------------- |
| String         | <p>Minimum Length</p><p>Maximum Length</p><p>Regular Expression</p> |
| Integer        | <p>Minimum</p><p>Maximum</p>                                        |
| Bool           | Boolean Types                                                       |

{% hint style="info" %}
We provide a regular expression rule for strings to come up with whatever crafty regex you require.
{% endhint %}

The Type and Rules can be set during parameter creation or when editing a parameter.

<figure><img src="/files/SMZ81P7bQW1nEN677Zjw" alt="" width="467"><figcaption></figcaption></figure>

<figure><img src="/files/MBcaF3xBrocJzv2K9HKU" alt="" width="563"><figcaption><p>Value typed is shorter than the minimum length</p></figcaption></figure>

<figure><img src="/files/esM6Rs1vL1xZaDEr3vsp" alt="" width="563"><figcaption><p>Value is longer than maximum allowed length</p></figcaption></figure>

{% hint style="info" %}
When adding rules to an existing parameter, CloudTruth will check across all environments to make sure the existing values conform to the new rule(s). If any of the values do *NOT* conform to the proposed rule change, the app will display the what and how the rule conflicts. Those conflicts will have to be remediated prior to setting the rule.
{% endhint %}

<figure><img src="/files/3n0Sz3k9B3jJK5ACFljW" alt="" width="464"><figcaption><p>Adding a rule to an existing parameter where an environment value does not match the rule </p></figcaption></figure>

<figure><img src="/files/0HqYerEniRcMWUS00bDI" alt=""><figcaption><p>Error message when rule cannot be applied due to an existing value mismatch</p></figcaption></figure>

The rule type and constraint settings are listed in the parameter's detail page for convenience.

<figure><img src="/files/aX3yhQ9wxrSF2XeLiHYm" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cloudtruth.com/configuration-management/parameters/rules-and-type.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
