hashicorp / terraform-provider-consul

Terraform Consul provider
https://www.terraform.io/docs/providers/consul/
Mozilla Public License 2.0
124 stars 112 forks source link

resource consul_prepared_query doesn't support RemoveEmptyTags in template #351

Closed xelite closed 1 year ago

xelite commented 1 year ago

I would like to create prepared query in consul via terraform, but I can't set flag RemoveEmptyTags. It seems like provider doesnt support that. My code:


resource "consul_prepared_query" "generic-service-one-tags" {
  name    = ""
  template {
    type   = "name_prefix_match"
    regexp = "^([^\\-]+)(?:-([^\\-]+))?(?:-([^\\-]+))?(?:-([^\\-]+))?$"

    removeemptytags = true # <--- this is not supported
  }

  service = "$${match(1)}"
  tags = [
    "$${match(4)}",
    "$${match(3)}",
    "$${match(2)}"
  ]

  dns {
    ttl = "5m"
  }
}
remilapeyre commented 1 year ago

Hi @xelite, thanks for opening this feature request.

remove_empty_tags is now available in the v2.18.0 release of the provider!