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

consul_config_entry fails with http-route kind #396

Open
flipyap opened this issue Feb 9, 2024 · 0 comments
Open

consul_config_entry fails with http-route kind #396

flipyap opened this issue Feb 9, 2024 · 0 comments

Comments

@flipyap
Copy link

flipyap commented Feb 9, 2024

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)

  • consul_config_entry

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 <file.hcl>) 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

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

No branches or pull requests

1 participant