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
  2. Templates

Sample Templates

Copy these samples into the CloudTruth Template editor

The samples include the relevant CloudTruth CLI command to fetch the template and assume the CloudTruth API key has been exported to an environment variable.

JSON

#
# Iterates through all parameters in the project
#
{
{%- for param in cloudtruth.parameters %}
  "{{param[0]}}": "{{param[1]}}"{%unless forloop.last%},{%endunless%}
{%- endfor %}
}
#
#
# Sample CloudTruth CLI command to fetch this template:
# Remove below after copying
#
# Assumes CloudTruth API key is exported to ENV variable
# 
cloudtruth --project {{cloudtruth.project}} template get "{{cloudtruth.self}}"

YAML

#
# Iterates through all parameters in the project
#
{%- for param in cloudtruth.parameters -%}
{{param[0]}}: {{param[1]}}
{% endfor -%}
}
#
#
# Sample CloudTruth CLI command to fetch this template:
# Remove below after copying
#
# Assumes CloudTruth API key is exported to ENV variable
# 
cloudtruth --project {{cloudtruth.project}} template get "{{cloudtruth.self}}"

ConfigMap

# 
# Sample ConfigMap template Kubetruth will fetch from the platform
#
{% assign params = cloudtruth.parameters | values | where: "secret", false -%}
{% assign version = cloudtruth.parameters | sort | to_json | sha256 | slice: 0, 7 -%}
{% if params.size > 0 -%}
kind: ConfigMap
metadata:
  name: "{{ cloudtruth.project }}"
  namespace: "{{ cloudtruth.environment }}"
  labels:
    version: "{{ version }}"
data:
  {%- for param in params %}
  {{ param.name | key_safe }}: |-
    {{ param.value }}
  {%- endfor %}
{% endif -%}

#
# Sample CloudTruth CLI command to fetch this template:
#
cloudtruth --project {{cloudtruth.project}} template get "{{cloudtruth.self}}"

ShellENV

#
# Iterates through all parameters in the project
#
{%- for param in cloudtruth.parameters %}
export {{param[0] | upcase}}="{{param[1]}}"
{%- endfor %}
#
#
# Sample CloudTruth CLI command to fetch this template:
#
cloudtruth --project {{cloudtruth.project}} template get "{{cloudtruth.self}}"y

TFVars

###
# Sample Liquid code to list all TF parameters for project {{cloudtruth.project}}
###
#
{%- for x in cloudtruth.parameters %}
TF_VAR_{{x[0]}}="{{x[1]}}"
{%- endfor %}
#
# Sample CloudTruth CLI command to fetch this template:
#
cloudtruth --project {{cloudtruth.project}} template get "{{cloudtruth.self}}"

Java Properties

#File Updated
# -
#{{ "now" | date: "%Y-%m-%d %H:%M" }}
#
#
{%- for param in cloudtruth.parameters -%}
{{param[0]}}={{param[1]}}
{% endfor -%}
#
# Sample CloudTruth CLI command to fetch this template:
#
cloudtruth --project {{cloudtruth.project}} template get "{{cloudtruth.self}}"
PreviousTemplatesNextActions

Last updated 1 year ago

Was this helpful?

🛠️
📒