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
  • Creating a dynamic value
  • Interpolation

Was this helpful?

  1. Config Management
  2. Parameters
  3. Parameter Management
  4. Internal Values

Dynamic Values

PreviousInternal ValuesNextExternal Values

Last updated 1 year ago

Was this helpful?

The dynamic values option provides the ability to reference parameters (standard or secret), templates, or other CloudTruth objects (project, environment, template) within a company's organization and interpolate their values. Dynamic values are obtained by using the logic-less template syntax.

Only non-secret parameters can contain Dynamic Values; however, they can reference parameters marked as secrets.

Creating a dynamic value

  1. After creating a new standard parameter, the ADD ENVIRONMENT VALUE modal is displayed, where clicking the DYNAMIC option switches the ENVIRONMENT VALUE input into a code editor and adds the Evaluate button for previewing the dynamic value before saving:

  1. Starting with two left-hand braces {{, the editor will automatically insert the two right-hand braces }}. Start typing cloudtruth to access the available automatic parameter options, we'll select project for this example:

  1. Click Evaluate to display the actual value of the parameter (to revert back the the code editor, click Show Raw):

  1. Once satisfied, click Save to save the dynamic value.

Interpolation

The ability to interpolate, or retrieve values from existing parameters, is a great way to automatically produce values for a given environment based on data within the environment. Here's a simple example:

Say we want to programmatically build a site per environment within a project. Normally, we would need to add a domain parameter for each environment which is unique such as:

  • production.example-app.com

Hard-coding these parameters and overriding the values in each environment is doable, but quickly becomes overhead and error prone when new environments are created. Interpolation gives us the ability to 'build' this value at retrieval time, every time. When new environments are added, the dynamic variable is inherited and produces the correct value when retrieved without the need to manually update the value. Here's how we might do this:

  1. Create a new project parameter for the default environment with a dynamic value which references the project:

  1. This will produce a domain with top-level-domain base for the project:

  1. Next, let's create another project parameter for the default environment with a dynamic value which references the environment and the previously created project parameter:

  1. This will produce the full-domain string in a per environment fashion for the project:

  1. Going back to the project's parameter list, we can see how useful this is by evaluating the values (click Show Evaluated) then selecting different environments to see the value update to reflect the currently selected environment:

This is a simple example of how interpolation produces values automatically and accurately every time they are retrieved and evaluated.

More information regarding available automatic parameters is covered in our Templates documentation in the section

🛠️
mustache
Automatic Parameters
DYNAMIC unchecked
DYNAMIC checked
development environment
production environment