kevholditch/terraform-provider-kong

Terraform 0.11 provider compatibility

michaelkoro opened this issue · 1 comments

Hi there,

I'm using terraform 0.11.4 (currently we don't have an option to upgrade our terraform version for these builds), kong version 2.1.4 and kong provider 5.2.1.

In the docs it is mentioned that the required terraform version is 0.10.x and higher, however I think 0.11 doesn't have full support, because I followed the docs and I don't think there is a configuration error.
Does the provider support terraform 0.11 ? is there a provider version that does support terraform 0.11 and kong 2.x ?

Terraform Version

0.11.4

Terraform Configuration Files

resource "kong_plugin" "request-transformer-public-access" {
  name     = "request-transformer"
  route_id = "${kong_route.route-external.id}"

  config_json = <<EOT
        {
          "add.headers": [
            "x-public-access:true"
          ]
        }
EOT
}

Expected Behavior

Terraform should create the plugin and associate it to the specified route.

Actual Behavior

Terraform fails with the error -

kong_plugin.request-transformer-public-access: Creating...
  computed_config: "" => "<computed>"
  config_json:     "" => "{\"config.add.headers\":[\"x-public-access:true\"]}"
  enabled:         "" => "true"
  name:            "" => "request-transformer"
  route_id:        "" => "aaaa-bbbb-cccc-dddd"

Error: Error applying plan:

1 error occurred:
        * kong_plugin.request-transformer-public-access: 1 error occurred:
        * kong_plugin.request-transformer-public-access: failed to create kong plugin: &{request-transformer <nil> <nil> 0xc0005ccfb0  map[config.add.headers:[x-public-access:true]] 0xc0004f4310} error: could not create plugin, err: {"message":"schema violation (config.config.add.headers: unknown field)","name":"schema violation","fields":{"config":{"config.add.headers":"unknown field"}},"code":2}

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply

Thanks for the help!

managed to make it work by changing the config json -

  config_json = <<EOT
        {
          "add": {
			"headers": ["x-public-access:true"]
		  }
        }
EOT