hashicorp / terraform-provider-consul

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

consul_config_entry fails with http-route kind #396

Open flipyap opened 6 months ago

flipyap commented 6 months ago

Terraform Version

╰─❯ terraform -v                                                                                                                          ─╯
Terraform v1.6.2
on darwin_amd64
+ provider registry.terraform.io/hashicorp/consul v2.20.0

Your version of Terraform is out of date! The latest version
is 1.7.2. You can update by downloading from https://www.terraform.io/downloads.html

Affected Resource(s)

Terraform Configuration Files

resource "consul_config_entry" "http_route_use1_example" {
  name = "counter-dashboard-ingress"
  kind = "http-route"

  config_json = jsonencode({
    Rules = [
      {
        Matches = [
          {
            Path = {
              Match = "prefix"
              Value = "/count"
            }
          }
        ]
        Services = [
          {
            Name      = "count-dashboard"
            Namespace = "default"
            Partition = "default"
            Filters = {
              URLRewrite = {
                Path = "/"
              }
            }
          }
        ]
      }
    ]

    Parents = [
      {
        Kind        = "api-gateway"
        Name        = "ingress-use1-mesh"
        Namespace   = "default"
        Partition   = "default"
        SectionName = "http-listener"
      }
    ]
  })
}

Debug Output

│ Error: failed to set 'counter-dashboard-ingress' config entry: Unexpected response code: 400 (Request decoding failed: 8 errors occurred:
│       * invalid config key "Rules[0].Filters.RetryFilter"
│       * invalid config key "Rules[0].Filters.TimeoutFilter"
│       * invalid config key "Rules[0].Filters.JWT"
│       * invalid config key "Rules[0].Services[0].Filters.RetryFilter"
│       * invalid config key "Rules[0].Services[0].Filters.TimeoutFilter"
│       * invalid config key "Rules[0].Services[0].Filters.JWT"
│       * invalid config key "Rules[0].Services[0].ResponseFilters"
│       * invalid config key "Rules[0].ResponseFilters")
│ 
│   with consul_config_entry.http_route_use1_example,
│   on connect.tf line 136, in resource "consul_config_entry" "http_route_use1_example":
│  136: resource "consul_config_entry" "http_route_use1_example" {

Expected Behavior

An exact hcl copy of this was provided via the consul CLI (consul config write ) and worked successfully.

Actual Behavior

failed

Steps to Reproduce

use the resource above to apply to consul (v1.16.2)

Important Factoids

None

References

None