Closed john-delivuk closed 1 year ago
According to the documentation at https://www.consul.io/docs/discovery/checks, all of the supported check types have a default timeout value that can optionally be overridden via the timeout
parameter.
Unless I'm overlooking something, this section of code for the consul_service
resource should be updated to reflect that timeout is an optional parameter.
Hi @john-delivuk, I don't remember precisely why I made the timeout
parameter required when I first implemented the support for health-checks. I think it was because the default timeout depends on the type of the health-check: we would have to reproduce the logic inthe Consul server to know whether the timeout sent back by the server on read is the actual default or if Terraform needs to override it. Things can also get complicated if the default timeout for a given health-check type changes between 2 Consul versions or if a new type is added.
IIRC this is why I had made the timeout
parameter required at the time. There is a few places were the dynamic behavior of Consul can make things tricky and I could not make guesses in the provider and had to force the user to be explicit. I will try to look for other ways to improve this, it may need some changes in Consul to make it more predictable thought.
Hi there,
Terraform Version
1.0.11
Affected Resource(s)
Please list the resources as a list, for example:
Terraform Configuration Files
Debug Output
Please provider a link to a GitHub Gist containing the complete debug output:
Expected Behavior
According to the docs, timeout is only used for HTTP checks. If this is true, timeout should not be required because TCP checks are an option. Otherwise, docs should be updated to state that TCP checks also need timeout, and respect it.
Actual Behavior
Required argument missing error is shown.
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform apply