Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: data "consul_agent_config_file" #395

Open
nfi-hashicorp opened this issue Feb 2, 2024 · 0 comments
Open

feature request: data "consul_agent_config_file" #395

nfi-hashicorp opened this issue Feb 2, 2024 · 0 comments

Comments

@nfi-hashicorp
Copy link

Generating a config file for a Consul agent currently means either using string templating to generate HCL or generating JSON. It would be nice if there were a data that would produce valid config HCL instead of having to resort to templating structured data with string templates, or JSON.

Similar to vault_policy_document.

It could look something like this:

data "consul_agent_config_file" "example" {
	datacenter = "east-aws"
	data_dir = "/opt/consul"
	log_level = "INFO"
	node_name = "foobar"
	server = true
	watches = [
	  {
	    type = "checks"
	    handler = "/usr/bin/health-check-handler.sh"
	  }
	]
	
	telemetry {
	  statsite_address = "127.0.0.1:2180"
	}
}

And then written to a file or wherever with data.consul_agent_config_file.example.hcl.

I'm easy on the names. Considering there is already a data called consul_agent_config which refers to fetching config with the API, I'm not sure what to call this to make it clear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant