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

Upgrade path for Kong provider #144

Open
sec23206 opened this issue Feb 16, 2022 · 6 comments
Open

Upgrade path for Kong provider #144

sec23206 opened this issue Feb 16, 2022 · 6 comments

Comments

@sec23206
Copy link

For general usage questions, please see: https://www.terraform.io/community.html.

I looked in the Terraform community forums but it doesn't appear that the Kong provider is discussed there. So apologies for posing a question here when I really shouldn't ...

Is there a recommended upgrade path/process to get from an older version of the provider to the most current? In our case, we're still using v5.2.1 with Terraform v0.12.6, and want to eliminate that "technical debt". The Terraform documentation describes what changes you need to account for when upgrading to each major version, but is there anything similar for the Kong provider?

Thanks in advance.

@kevholditch-f3
Copy link
Contributor

hey @sec23206, I'm afraid there is no documentation for how to do this. In general I'm afraid to say that this is going to be quite painful. The main reason being is that in version 5.2.1 plugins and plugin config was all managed using single terraform resources but in the latest version of terraform it is managed using strongly typed plugins for example to configure the jwt plugin you now use the kong_consumer_jwt_auth resource.

If you aren't doing too much plugin configuration and all of the plugins that you are using are supported by the new provider version then probably the easiest way to upgrade would be to remove the old config from state e.g. terraform state rm kong_consumer_plugin_config.my_plugin and then import using the new resource if there is a strongly typed equivilant. Hope that helps

@shawnchapla-8451
Copy link

Thanks for the feedback (and sorry for not responding sooner). This can be closed.

@rs-steve-stevens
Copy link

Hi @kevholditch-f3,
I'm just looking at making a similar update (kong_consumer_plugin_config -> kong_consumer_jwt_auth), but I don't believe the provider supports the import command for these resources. The documentation (here) doesn't reference an import mechanism, but I attempted to assume what the import would be if there was one (using the id from the old resource). eg

import {
  to = kong_consumer_key_auth.service_pub_key_auth
  id = "21da9275-670d-4213-983a-000000000000|key-auth|8c5bf812-244f-4357-90bb-000000000000"
}

Unfortunately, terraform reports that the import feature is unsupported.
Is this something that can be included in the provider for the kong_consumer_*** resources?

If not, I assume I could get away with just applying the "new" resource which will essentially make no change.

Thanks!

@devanshutanna
Copy link
Contributor

Hi @kevholditch-f3, any updates?

@devanshutanna
Copy link
Contributor

@rs-steve-stevens I've created this MR for making the kong_consumer_key_auth resource importable:
#154

@rs-steve-stevens
Copy link

Fantastic! I'll give it a try shortly!

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

5 participants