# hashicorp/consul-template

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/hashicorp-consul-template).**

4,830 stars · 794 forks · Go · MPL-2.0

## Links

- GitHub: https://github.com/hashicorp/consul-template
- Homepage: https://www.hashicorp.com/
- awesome-repositories: https://awesome-repositories.com/repository/hashicorp-consul-template.md

## Topics

`consul` `golang` `vault`

## Description

Consul Template is a configuration renderer and dynamic configuration manager that generates files by populating templates with data from Consul and Vault. It functions as a service discovery template engine and secrets management integrator, transforming cluster catalog and health data into formatted configuration files.

The tool distinguishes itself by acting as a process supervisor and notifier, capable of executing shell commands or restarting applications automatically after templates are updated. It features a long-polling watcher to monitor remote key-value stores and employs a shared locking mechanism to coordinate updates across multiple instances and prevent simultaneous service restarts.

The system covers a broad range of capabilities, including automated secret rotation for PKI certificates and vault credentials, data format transformation for JSON and YAML, and the execution of external binary plugins for custom data processing. It also provides infrastructure bootstrapping and distributed rendering synchronization to reduce API load through leader-based query deduplication.

## Tags

### Development Tools & Productivity

- [Configuration File Generation](https://awesome-repositories.com/f/development-tools-productivity/environment-variable-templating/configuration-file-generation.md) — Generates physical configuration files on disk by populating templates with service discovery and secret data. ([source](https://github.com/hashicorp/consul-template/blob/main/README.md))
- [Go Template Rendering](https://awesome-repositories.com/f/development-tools-productivity/data-transformation/template-helpers/go-template-rendering.md) — Uses Go's text/template engine to dynamically render configuration files by injecting discovery and secret data.
- [File-Change-Triggered Commands](https://awesome-repositories.com/f/development-tools-productivity/custom-command-execution/file-change-triggered-commands.md) — Executes external shell commands or scripts automatically after a template update to notify or restart services. ([source](https://github.com/hashicorp/consul-template/blob/main/docs/configuration.md))
- [Infrastructure Bootstrapping Templates](https://awesome-repositories.com/f/development-tools-productivity/project-bootstrapping-templates/infrastructure-bootstrapping-templates.md) — Renders system files and environment variables based on cluster state during node deployment or startup.
- [Template Functions](https://awesome-repositories.com/f/development-tools-productivity/template-extensions/template-functions.md) — Injects custom functions into the template engine to provide specialized data processing or logic. ([source](https://github.com/hashicorp/consul-template/blob/main/CHANGELOG.md))

### DevOps & Infrastructure

- [Configuration Renderers](https://awesome-repositories.com/f/devops-infrastructure/configuration-renderers.md) — Generates configuration files by populating templates with real-time data from Consul and Vault.
- [Configuration-Driven Templating Engines](https://awesome-repositories.com/f/devops-infrastructure/configuration-management/template-and-generation-engines/configuration-driven-templating-engines.md) — Functions as a template engine that generates configuration files based on cluster catalog and health data.
- [Dynamic Configuration Management](https://awesome-repositories.com/f/devops-infrastructure/dynamic-configuration-management.md) — Generates application configuration files from Consul and Vault that update automatically when values change.
- [Post-Render Command Executions](https://awesome-repositories.com/f/devops-infrastructure/post-render-command-executions.md) — Consul Template runs shell scripts or commands automatically after templates render to reload applications or restart services. ([source](https://github.com/hashicorp/consul-template/blob/main/CHANGELOG.md))
- [Signal-Based Reloading](https://awesome-repositories.com/f/devops-infrastructure/application-server-configurations/dynamic-configuration-reloading/signal-based-reloading.md) — Triggers application settings refresh by sending OS signals to child processes when configuration files change.
- [Cluster Node Management](https://awesome-repositories.com/f/devops-infrastructure/cluster-node-management.md) — Allows fetching details for all nodes or specific nodes within a cluster catalog for environment-specific configuration. ([source](https://github.com/hashicorp/consul-template/blob/main/docs/templating-language.md))
- [Distributed Render Synchronization](https://awesome-repositories.com/f/devops-infrastructure/distributed-leader-election/distributed-render-synchronization.md) — Uses leader election to render templates once and share the output via a global key-value store. ([source](https://github.com/hashicorp/consul-template/blob/main/CHANGELOG.md))
- [Distributed Lock Coordination](https://awesome-repositories.com/f/devops-infrastructure/distributed-lock-coordination.md) — Prevents simultaneous configuration updates across multiple instances using a shared distributed locking mechanism. ([source](https://github.com/hashicorp/consul-template/blob/main/docs/configuration.md))
- [Distributed Locks](https://awesome-repositories.com/f/devops-infrastructure/distributed-locks.md) — Employs distributed locks to synchronize updates across instances and prevent simultaneous service restarts.
- [Query Deduplication](https://awesome-repositories.com/f/devops-infrastructure/query-deduplication.md) — Elects a single instance to fetch shared data and distribute results to others to reduce API load.
- [Orchestrator Data Retrieval](https://awesome-repositories.com/f/devops-infrastructure/service-discovery-orchestrators/orchestrator-data-retrieval.md) — Retrieves service discovery data and secrets from a cluster manager to populate configuration templates. ([source](https://github.com/hashicorp/consul-template/blob/main/docs/configuration.md))

### Data & Databases

- [Key Retrievals](https://awesome-repositories.com/f/data-databases/key-value-data-manipulation/key-lookups-by-value/key-retrievals.md) — Retrieves values from a key-value store by path using defaults or existence checks. ([source](https://github.com/hashicorp/consul-template/blob/main/docs/templating-language.md))
- [Prefix-Based Key Retrievals](https://awesome-repositories.com/f/data-databases/key-value-pair-managers/prefix-based-key-retrievals.md) — Returns all keys and values under a specific prefix from a registry. ([source](https://github.com/hashicorp/consul-template/blob/main/docs/templating-language.md))
- [Data Format Transformations](https://awesome-repositories.com/f/data-databases/data-format-transformations.md) — Converts data structures into JSON, YAML, TOML, or base64 strings with pretty-printing. ([source](https://github.com/hashicorp/consul-template/blob/main/docs/templating-language.md))

### Networking & Communication

- [Consul Service Discovery](https://awesome-repositories.com/f/networking-communication/distributed-systems-p2p/distributed-systems-coordination/service-discovery-mechanisms/consul-service-discovery.md) — Integrates with Consul for automatic service discovery and health monitoring to drive configuration templates. ([source](https://github.com/hashicorp/consul-template/blob/main/CHANGELOG.md))
- [Service Discovery Integrations](https://awesome-repositories.com/f/networking-communication/service-discovery-integrations.md) — Provides integration with service registries to dynamically populate configuration files with healthy service instances.
- [Resource Querying](https://awesome-repositories.com/f/networking-communication/cluster-discovery-services/resource-querying.md) — Enables querying of services and variables registered within a cluster orchestrator to use as template data. ([source](https://github.com/hashicorp/consul-template/blob/main/docs/templating-language.md))

### Security & Cryptography

- [Automated Secret Rotation](https://awesome-repositories.com/f/security-cryptography/automated-secret-rotation.md) — Automatically tracks credential expiration and refreshes rotating secrets to ensure continuous service availability.
- [Secret Management Integrations](https://awesome-repositories.com/f/security-cryptography/secret-management-integrations.md) — Integrates with external secret management services to securely retrieve credentials and certificates for local deployment.
- [Secret Retrieval Interfaces](https://awesome-repositories.com/f/security-cryptography/secret-retrieval-interfaces.md) — Provides mechanisms for securely fetching credentials and sensitive data from protected stores to populate configuration files. ([source](https://github.com/hashicorp/consul-template/blob/main/docs/configuration.md))
- [Secrets Management](https://awesome-repositories.com/f/security-cryptography/secrets-management.md) — Provides comprehensive management of secrets from HashiCorp Vault, including versioning and lease renewal. ([source](https://github.com/hashicorp/consul-template/blob/main/docs/templating-language.md))
- [Secret Vault Integrations](https://awesome-repositories.com/f/security-cryptography/security/cryptography-and-secrets/secrets-credential-management/secret-vault-integrations.md) — Extracts sensitive credentials from Vault using KV v2 engines and token unwrapping. ([source](https://github.com/hashicorp/consul-template/blob/main/CHANGELOG.md))
- [PKI Automation](https://awesome-repositories.com/f/security-cryptography/pki-automation.md) — Automates the retrieval and rotation of PEM-encoded certificates and keys from a PKI engine. ([source](https://github.com/hashicorp/consul-template/blob/main/docs/templating-language.md))

### Software Engineering & Architecture

- [Long-Polling Queries](https://awesome-repositories.com/f/software-engineering-architecture/event-driven-architectures/polling-mechanisms/long-polling-queries.md) — Uses long-polling blocking queries to monitor remote key-value stores for immediate template re-rendering.
- [Service Discovery Registries](https://awesome-repositories.com/f/software-engineering-architecture/service-discovery-registries.md) — Maintains dynamic registries of service locations, node details, and key-value pairs for configuration rendering. ([source](https://github.com/hashicorp/consul-template/blob/main/CHANGELOG.md))
- [Service Instance Discovery](https://awesome-repositories.com/f/software-engineering-architecture/service-discovery-registries/service-instance-lifecycle-management/service-instance-discovery.md) — Identifies and links to active, healthy service instances via a registry to ensure traffic is routed to available nodes. ([source](https://github.com/hashicorp/consul-template/blob/main/docs/templating-language.md))
- [Atomic File Writes](https://awesome-repositories.com/f/software-engineering-architecture/atomic-file-writes.md) — Ensures configuration integrity by writing updates to temporary files before performing an atomic rename.
- [Standalone Binary Plugin Executions](https://awesome-repositories.com/f/software-engineering-architecture/plugin-execution-engines/standalone-binary-plugin-executions.md) — Executes external binaries to process template data and returns the output as a string. ([source](https://github.com/hashicorp/consul-template/blob/main/docs/plugins.md))

### System Administration & Monitoring

- [Dynamic Configuration Retrieval](https://awesome-repositories.com/f/system-administration-monitoring/cluster-management/catalog-management/dynamic-configuration-retrieval.md) — Implements real-time retrieval of service information and key-value pairs from a registry to enable dynamic configurations. ([source](https://github.com/hashicorp/consul-template/blob/main/docs/configuration.md))
- [Process Supervisors](https://awesome-repositories.com/f/system-administration-monitoring/background-process-management/automatic-crash-recovery/process-supervisors.md) — Manages the lifecycle of child processes, automatically restarting or reloading them when configuration templates change.
- [Configurable File Writing](https://awesome-repositories.com/f/system-administration-monitoring/configurable-file-writing.md) — Saves template content to specific paths with configurable file permissions and ownership. ([source](https://github.com/hashicorp/consul-template/blob/main/docs/templating-language.md))
- [Process Supervision](https://awesome-repositories.com/f/system-administration-monitoring/process-supervision.md) — Monitors child processes and automatically restarts or reloads them when underlying configuration templates are updated. ([source](https://github.com/hashicorp/consul-template/blob/main/CHANGELOG.md))

### Hardware & IoT

- [Rendering Pipeline Plugins](https://awesome-repositories.com/f/hardware-iot/integration-performance/hardware-interfacing-integration/hardware-integration/device-sensors/external-integrations/external-process-plugins/rendering-pipeline-plugins.md) — Executes external binaries during the rendering pipeline to process data and return results as strings.

### Operating Systems & Systems Programming

- [Configuration-Driven Process Management](https://awesome-repositories.com/f/operating-systems-systems-programming/kernel-core-internals/process-and-memory-management/memory-management/process-lifecycle-orchestrators/child-process-management-helpers/configuration-driven-process-management.md) — Spawns application processes after rendering and manages their lifecycle via reload or termination signals. ([source](https://github.com/hashicorp/consul-template))

### Web Development

- [Custom Data Processing Plugins](https://awesome-repositories.com/f/web-development/analytics-tracking/plugin-executions/custom-data-processing-plugins.md) — Executes external plugins with optional payloads to perform custom data processing during the rendering pipeline. ([source](https://github.com/hashicorp/consul-template/blob/main/docs/templating-language.md))
