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

Argument "name" in resource kong_route not expected #114

Closed
igorceridorio opened this issue Sep 22, 2020 · 1 comment
Closed

Argument "name" in resource kong_route not expected #114

igorceridorio opened this issue Sep 22, 2020 · 1 comment

Comments

@igorceridorio
Copy link

igorceridorio commented Sep 22, 2020

Hi there,

I ran into an issue that might be an error regarding creation of a new kong_route using the version 1.12.0. I am working with Terraform v0.13.3.

When I try to create a new kong_route specifying a parameter name = "route-name" I get the following error:

Error: Unsupported argument

  on main.tf line 24, in resource "kong_route" "route-api-example-endpoint":
  24:     name            = "route-api-example/endpoint"

An argument named "name" is not expected here.

Interesting, though, is that when I create a kong_service and specify a parameter name everything works fine. Below is my .tf example file.

Affected Resource(s)

  • kong_route

Terraform Configuration Files

terraform {
    required_providers {
        kong = {
            source = "example.com/mycorp/kong"
            version = "~> 1.12.0"
        }
    }
}    

provider "kong" {
    kong_admin_uri      = var.kong_admin_uri
    kong_admin_username = var.kong_admin_username
    kong_admin_password = var.kong_admin_password
}

resource "kong_service" "service-api-example" {
    name        = "service-api-example"
    protocol    = "http"
    host        = "httpbin.org"
    port        = 80
}

resource "kong_route" "route-api-example-endpoint" {
    name            = "route-api-example/endpoint"
    methods         = [ "GET" ]
    protocols 	    = [ "http" ]
    paths           = ["/get"]
    strip_path 	    = true
    preserve_host   = false
    service_id 	    = kong_service.service-api-example.id
}

So I switched back to provider version 5.2.1 and executing the same .tf file everything works as expected and the name parameter of kong_route just works.

Any thoughts on that?
Thanks!

@vaibhavkhurana2018
Copy link

This is because the provider was updated with reference to kong v1.0.0.

The release date is confusing because 1.12 is updated post 5.2.1, but if you see the readme, it is mentioned to use >v2.0 https://github.com/kevholditch/terraform-provider-kong#important

It's the date that would have confused.

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

3 participants