Skip to content

Terraform plan doesn't detect multiple plugins associated to the same route #84

Open
@ag91

Description

@ag91

Thanks for maintaining this module. It is cool to manage kong via text editing.
I got surprised a couple of times by errors not picked up by terraform plan but picked up by terraform apply for this module.
Yesterday I could record the following one.

I suspect the root cause seems to be that on terraform plan this module validates syntax but doesn't do dry-run API calls to test that the new resources respect Kong's rules. (Maybe that could explain also this one?)

Steps to reproduce:

  1. define a route
  2. add a plugin
  3. set plugin's route id to initial route
  4. create a new plugin
  5. associate to the same route

Actual behavior:
terraform plan succeeds and terraform apply fails with with an error similar to:

"type":"ERROR_TYPE_REFERENCE","messages":["unique-plugin-per-entity
(type: unique) constraint failed for value'acl....'

Expected behavior:
terraform plan fails with the same error

Bonus points:

terraform plan fails with a human friendly explanation, on the lines

Multiple plugins [names&ids] are not allowed for the same route [name&id].

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions