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

How to add weights to a service #310

Open
nbari opened this issue Jun 29, 2022 · 1 comment
Open

How to add weights to a service #310

nbari opened this issue Jun 29, 2022 · 1 comment

Comments

@nbari
Copy link

nbari commented Jun 29, 2022

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?

@remilapeyre
Copy link
Collaborator

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.

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

No branches or pull requests

2 participants