This Terraform module creates local text files. Using this module in automation with Consul Terraform Sync (CTS) will dynamically create or delete text files based off of configured services. This module is useful for testing CTS to observe how it responds to changes in Consul catalog.
The module uses the local
Terraform provider to create text files. A directory "resources" is created in the CTS generated task subdirectory. The text files are named after the monitored Consul service instances.
Ecosystem | Version |
---|---|
consul | >= 1.8 |
consul-terraform-sync | >= 0.4.0 |
terraform | >= 0.13 |
Name | Version |
---|---|
local | >= 2.0.0 |
No setup is needed
User Config for Consul Terraform Sync
See Securely Configure Terraform Providers for alternatives to directly inserting token in config file.
example.hcl
task {
name = "task_example"
services = ["api"]
version = "0.0.1"
source = "lornasong/cts_kv_file/local"
condition "consul-kv" {
path = "key"
source_includes_var = true
recurse = true
}
}