| page_title | sidebar_current | description |
|---|---|---|
helm: helm_template |
docs-helm-template |
Render chart templates locally.
helm_template renders chart templates locally and exposes the rendered manifests in the data source attributes. helm_template mimics the functionality of the helm template command.
The arguments aim to be identical to the helm_release resource.
For further details on the helm template command, refer to the Helm documentation.
chart(String) Chart name to be installed. A path may be used.name(String) Release name.
api_versions(List of String) Kubernetes api versions used for Capabilities.APIVersionsatomic(Boolean) If set, installation process purges chart on fail. The wait flag will be set automatically if atomic is used. Defaults tofalse.crds(List of String) List of rendered CRDs from the chart.create_namespace(Boolean) Create the namespace if it does not exist. Defaults tofalse.dependency_update(Boolean) Run helm dependency update before installing the chart. Defaults tofalse.description(String) Add a custom descriptiondevel(Boolean) Use chart development versions, too. Equivalent to version '>0.0.0-0'. Ifversionis set, this is ignoreddisable_openapi_validation(Boolean) If set, the installation process will not validate rendered templates against the Kubernetes OpenAPI Schema.Defaults tofalse.disable_webhooks(Boolean) Prevent hooks from running.Defaults to300seconds.include_crds(Boolean) Include CRDs in the templated outputis_upgrade(Boolean) Set .Release.IsUpgrade instead of .Release.IsInstallkeyring(String) Location of public keys used for verification. Used only ifverifyis true. Defaults to/.gnupg/pubring.gpgin the location set byhome.kube_version(String) Kubernetes version used for Capabilities.KubeVersionmanifest(String) Concatenated rendered chart templates. This corresponds to the output of thehelm templatecommand.manifests(Map of String) Map of rendered chart templates indexed by the template name.namespace(String) Namespace to install the release into. Defaults todefault.notes(String) Rendered notes if the chart contains aNOTES.txt.pass_credentials(Boolean) Pass credentials to all domains. Defaults tofalse.postrender(Block List, Max: 1) Postrender command configuration. (see below for nested schema)render_subchart_notes(Boolean) If set, render subchart notes along with the parent. Defaults totrue.replace(Boolean) Re-use the given name, even if that name is already used. This is unsafe in production. Defaults tofalse.repository(String) Repository where to locate the requested chart. If is a URL the chart is installed without installing the repository.repository_ca_file(String) The Repositories CA Filerepository_cert_file(String) The repositories cert filerepository_key_file(String) The repositories cert key filerepository_password(String, Sensitive) Password for HTTP basic authenticationrepository_username(String) Username for HTTP basic authenticationreset_values(Boolean) When upgrading, reset the values to the ones built into the chart.Defaults tofalse.reuse_values(Boolean) When upgrading, reuse the last release's values and merge in any overrides. If 'reset_values' is specified, this is ignored. Defaults tofalse.set(Block Set) Custom values to be merged with the values. (see below for nested schema)set_list(Block List) Custom list values to be merged with the values. (see below for nested schema)set_sensitive(Block Set) Custom sensitive values to be merged with the values. (see below for nested schema)set_string(Block Set, Deprecated) Custom string values to be merged with the values. (see below for nested schema)show_only(List of String) Only show manifests rendered from the given templatesskip_crds(Boolean) If set, no CRDs will be installed. By default, CRDs are installed if not already present. Defaults tofalse.skip_tests(Boolean) If set, tests will not be rendered. By default, tests are rendered. Defaults tofalse.timeout(Number) Time in seconds to wait for any individual kubernetes operation. Defaults to300seconds.validate(Boolean) Validate your manifests against the Kubernetes cluster you are currently pointing at. This is the same validation performed on an installvalues(List of String) List of values in raw yaml format to pass to helm.verify(Boolean) Verify the package before installing it.Defaults tofalse.version(String) Specify the exact chart version to install. If this is not specified, the latest version is installed.wait(Boolean) Will wait until all resources are in a ready state before marking the release as successful.Defaults totrue.
id(String) The ID of this resource.
Required:
binary_path(String) The command binary path.
Required:
name(String)value(String)
Optional:
type(String)
Required:
name(String)value(List of String)
Required:
name(String)value(String, Sensitive)
Optional:
type(String)
Required:
name(String)value(String)
The following example renders all templates of the mariadb chart of the official Helm stable repository. Concatenated manifests are exposed as output variable mariadb_instance_manifest.
data "helm_template" "mariadb_instance" {
name = "mariadb-instance"
namespace = "default"
repository = "https://charts.helm.sh/stable"
chart = "mariadb"
version = "7.1.0"
set = [
{
name = "service.port"
value = "13306"
}
]
set_sensitive = [
{
name = "rootUser.password"
value = "s3cr3t!"
}
]
}
resource "local_file" "mariadb_manifests" {
for_each = data.helm_template.mariadb_instance.manifests
filename = "./${each.key}"
content = each.value
}
output "mariadb_instance_manifest" {
value = data.helm_template.mariadb_instance.manifest
}
output "mariadb_instance_manifests" {
value = data.helm_template.mariadb_instance.manifests
}
output "mariadb_instance_notes" {
value = data.helm_template.mariadb_instance.notes
}The following example renders only the templates master-statefulset.yaml and master-svc.yaml of the mariadb chart of the official Helm stable repository.
data "helm_template" "mariadb_instance" {
name = "mariadb-instance"
namespace = "default"
repository = "https://charts.helm.sh/stable"
chart = "mariadb"
version = "7.1.0"
show_only = [
"templates/master-statefulset.yaml",
"templates/master-svc.yaml",
]
set = [
{
name = "service.port"
value = "13306"
}
]
set_sensitive = [
{
name = "rootUser.password"
value = "s3cr3t!"
}
]
}
resource "local_file" "mariadb_manifests" {
for_each = data.helm_template.mariadb_instance.manifests
filename = "./${each.key}"
content = each.value
}
output "mariadb_instance_manifest" {
value = data.helm_template.mariadb_instance.manifest
}
output "mariadb_instance_manifests" {
value = data.helm_template.mariadb_instance.manifests
}
output "mariadb_instance_notes" {
value = data.helm_template.mariadb_instance.notes
}