> For the complete documentation index, see [llms.txt](https://docs.cloudtruth.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cloudtruth.com/configuration-management/parameters/rules-and-type.md).

# Value Validation

This, not that.

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="https://2952342643-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MGjN2Xg1mE8iTvg49dw%2Fuploads%2FRHuMuQaBiXAycsdT34OH%2Fimage.png?alt=media&amp;token=b5ec2839-0076-4066-acba-d5bf3a2e090d" alt="" width="467"><figcaption></figcaption></figure>

<figure><img src="https://2952342643-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MGjN2Xg1mE8iTvg49dw%2Fuploads%2FB9uuqijJ6l8SXH9Fw5wg%2Fimage.png?alt=media&amp;token=e8b99749-b3ef-4548-8230-98c6a6e473a4" alt="" width="563"><figcaption><p>Value typed is shorter than the minimum length</p></figcaption></figure>

<figure><img src="https://2952342643-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MGjN2Xg1mE8iTvg49dw%2Fuploads%2F3CUVB1v9uGootH1NfcHm%2Fimage.png?alt=media&amp;token=fd087b49-14e2-4c4e-a56e-4637f69b78fa" 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="https://2952342643-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MGjN2Xg1mE8iTvg49dw%2Fuploads%2FIHIDRpnF1JP34lHJgv28%2Fimage.png?alt=media&amp;token=965b62ed-07c2-41b9-a661-652a028496de" 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="https://2952342643-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MGjN2Xg1mE8iTvg49dw%2Fuploads%2FPbvIqZtSYCYbuLFJvkWA%2Fimage.png?alt=media&amp;token=71360fa5-d098-4af2-ab03-03cd1dca41ef" 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="https://2952342643-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MGjN2Xg1mE8iTvg49dw%2Fuploads%2FtvylnYQkEDPKBb07DoEp%2Fimage.png?alt=media&amp;token=335e5680-5fbc-43e5-aa71-aa6dea245b15" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
