> 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/types.md).

# Types

Manage type checking parameter values with rules and ranges. Use the Type feature for guardrails, policy enforcement and eliminating misconfigurations.

Managing Types requires Contributor or Admin permissions.&#x20;

Select **Types** under the **Admin** menu to open the screen below. (First-time customers will see an empty screen.)

<figure><img src="https://2952342643-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MGjN2Xg1mE8iTvg49dw%2Fuploads%2FTci49gchlYQQ9y38ZD5o%2FCT-Docs-Types-1.png?alt=media&amp;token=239ce389-e410-4ff0-9ab6-56a9510756fe" alt=""><figcaption><p>Example of a populated list of Types.</p></figcaption></figure>

1. List of base types and what they do.&#x20;

Boolean:  Can be used directly for parameters or as a parent for custom types. Automatically includes permutations such as Yes, No, True, False.

Enum:  Must be used as a parent for custom types. Create lists that scope the selection to only approved values.

Integer: This can be used directly for parameters or as a parent for custom types.

String:  This can be used directly for parameters or as a parent for custom types. The string type is the base type for regular expressions (Regex).

2. An example of a type rule that uses a regex to validate an AWS Region is correctly formatted.

<figure><img src="https://2952342643-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MGjN2Xg1mE8iTvg49dw%2Fuploads%2FrZdhujrSljOuoEYHYMmF%2FCT-Docs-Types-Regex.png?alt=media&amp;token=683c3e9c-fc9d-4842-a7d6-0125e29e1060" alt="" width="375"><figcaption><p>Sample regular expression.</p></figcaption></figure>

3. An example of an enum list to validate a parameter value is correct.

<figure><img src="https://2952342643-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MGjN2Xg1mE8iTvg49dw%2Fuploads%2FAU1MVmzMWvx6dljK6AY3%2FCT-Docs-Types-enum.png?alt=media&amp;token=c9fa5cef-7fab-4ae0-ad95-5de858f2b206" alt="" width="375"><figcaption><p>Sample list of enums for the type "AWS Regions List".</p></figcaption></figure>

Use the UI for short enum lists or the API to bulk-add longer list items.&#x20;

Copy the code below and replace the API\_KEY value with an API key for your organization with Contributor or Admin permissions.&#x20;

```
#!/bin/bash

API_KEY="YOUR-API-KEY"

usage() { echo "Usage: $0 [-n <enum name>] [-r <rules>]" 1>&2; exit 1; }

while getopts ":n:d:r:" o; do
    case "${o}" in
        n)
            enum_name=${OPTARG}
            ;;
		d)
			enum_desc=${OPTARG}
			;;		
		r)
            constraints=${OPTARG}
            ;;
        *)
            usage
            ;;
    esac
done
shift $((OPTIND-1))

if [ -z "${enum_name}" ] || [ -z "${constraints}" ] || [ "${API_KEY}" == "fill-me-in" ]
then
    usage
fi

data_str='{"name":"'${enum_name}'","description":"'${enum_desc}'","parent":"https://api.cloudtruth.io/api/v1/types/1b606a2f-197d-4173-a588-70c12c8b794d/"}'
response=$(curl -X POST 'https://api.cloudtruth.io/api/v1/types/' -H 'content-type: application/json' -H 'authorization: Api-Key '"${API_KEY}" --data-raw "${data_str}")

echo "${response}"
type_id=`echo "${response}" | jq -r '.id'`
echo "Type ID: ${type_id}"

curl -X POST 'https://api.cloudtruth.io/api/v1/types/'"${type_id}"'/rules/' \
  -H 'authorization: Api-Key '"${API_KEY}" \
  -H 'content-type: application/json' \
  --data-raw '{"type":"one_of","constraints":'"${constraints}"',"typeId":"'"${type_id}"'"}'
```

Sample command line for the script (assumes the script file is named "create\_enum.sh"):

-n Type name (should be short)

-d Description

-r List items. Use quote comma-separated structure

```
./create_enum.sh -n "Fetch Interval" -d "Interval to trigger a fetch." -r '["daily", "weekly", "monthly"]'
```


---

# 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/types.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.
