> 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/using-basic-templates/sample-templates.md).

# Sample Templates

### Copy these samples into the CloudTruth Template editor

{% hint style="info" %}
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.&#x20;
{% endhint %}

#### JSON

<pre class="language-liquid" data-line-numbers><code class="lang-liquid"><strong>#
</strong><strong># Iterates through all parameters in the project
</strong><strong>#
</strong>{
{%- 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}}"
</code></pre>

#### YAML

{% code lineNumbers="true" %}

```liquid
#
# 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}}"
```

{% endcode %}

#### ConfigMap

{% code lineNumbers="true" %}

```liquid
# 
# 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}}"
```

{% endcode %}

#### ShellENV

{% code lineNumbers="true" %}

```liquid
#
# 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
```

{% endcode %}

#### TFVars

```liquid
###
# 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

```liquid
#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}}"
```


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.cloudtruth.com/configuration-management/using-basic-templates/sample-templates.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
