CloudTruth Documentation
Sign InAPIIntegrationsGitHubVisit our website
  • Overview
  • Getting Started
  • Architecture
    • 🔒Security Overview
  • Copilot
  • 🏢Org management
    • Account Setup
    • Access Control
      • 🔑API Tokens
      • 🌐Protecting Projects and Environments
      • 👥Users
    • Audit Log
  • 🛠️Config Management
    • Projects
    • Parameters
      • Sharing Config Data
      • Parameter Management
        • Internal Values
          • Dynamic Values
        • External Values
          • Terraform Remote State Files
        • Parameter Override
        • Environment Value Override
      • Parameter and Parameter Value Inheritance
      • Value Comparison
      • Value History
      • Value Validation
      • Value Expiration
    • Environments and Tags
    • Templates
      • 📒Sample Templates
    • Actions
      • Import Actions
      • Push Actions
    • CLI & API
      • CloudTruth CLI
      • Rest API
    • Integrations
      • Argo CD
      • Atlassian Compass
      • AWS
        • AWS Connection
        • AWS Role
          • CloudFormation
          • Terrraform
          • AWS Console
        • Parameter Store (SSM)
        • S3
        • Secrets Manager
      • Azure Key Vault
      • Bitbucket Pipelines
      • Docker
      • Docker Compose
      • GitHub
      • GitHub Actions
      • GitLab
      • Harness
      • Jenkins
      • Kubernetes
      • Pulumi
      • Terraform
      • Terragrunt
      • Explorer
      • Circle CI
    • Events, Notifications, Webhooks
    • Types
  • 🔎REPORTING
    • Compare
    • History
    • Expirations
  • 🚀PRODUCT
    • What is CloudTruth?
    • Interactive Demo
    • Kubernetes
    • Terraform
    • CI/CD Pipeline Configuration
    • Cloud CMDB
    • Secrets Management
    • GitOps
    • Our Manifesto
    • Open Source
    • FAQs
    • Our Mission
  • 📚Reference
    • 🎓Quick Start Videos
      • What is CloudTruth?
      • CloudTruth in Action
      • Environments and Projects
      • Secrets, Parameters, ENV variables
      • Audit Logs, RBAC, SSO
      • Containers - Kubernetes, Docker
      • Infrastructure as Code (IaC) - Terraform, Cloudformation, CDK, Azure Bicep, Pulumi
      • CICD Pipelines - GitHub Actions, ArgoCD, Jenkins, CircleCI, Harness, GitLab Pipelines
      • AWS Videos - Secret Manager, Parameter Store, S3, IAM
      • Azure Videos - Azure DevOps, Azure Bicep, PowerShell
    • Knowledge Base
      • Best Practices
        • Versioned Releases
      • CLI
        • History comparison of deleted parameters with null values
      • Integrations
        • Advanced AWS IAM policy permissions
        • K8s pull image from private Docker registry
        • S3 Region Selection
      • Templates
        • Templates render quotations in key values as quot
    • Roadmap and New Features
    • JMESPath Reference
    • REST API
Powered by GitBook

Copyright© 2023 CloudTruth

On this page

Was this helpful?

  1. Config Management

Types

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

PreviousEvents, Notifications, WebhooksNextCompare

Last updated 8 months ago

Was this helpful?

Managing Types requires Contributor or Admin permissions.

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

  1. List of base types and what they do.

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).

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

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

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

Copy the code below and replace the API_KEY value with an API key for your organization with Contributor or Admin permissions.

#!/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"]'

🛠️
Example of a populated list of Types.
Sample regular expression.
Sample list of enums for the type "AWS Regions List".