terraform-provider-consul
terraform-provider-consul copied to clipboard
How to add weights to a service
I am creating a service to be used with HAProxy server-template
, something like this:
resource "consul_service" "test" {
name = "test"
service_id = "test-2"
node = consul_node.test.name
port = 443
weights = {
passing = 100,
warning = 1
}
}
But I get:
╷
│ Error: Unsupported argument
│
│ on lb_test.tf line 6, in resource "consul_service" "test":
│ 6: weights = {
│
│ An argument named "weights" is not expected here.╵
From here, consul seems to support weights: https://github.com/hashicorp/consul/pull/4468/files but how to use them from terraform?
Hi @nbari, it is currently not possible because of the version of the provider SDK we are using in the Consul provider. I've been keeping the old SDK for backward compatibility with old versions of Terraform but plan on updating over the next month.