launchdarkly / terraform-provider-launchdarkly

Terraform LaunchDarkly provider
https://www.terraform.io/docs/providers/launchdarkly/
Mozilla Public License 2.0
23 stars 24 forks source link

Manage Kinds using Terraform #183

Open atalema opened 1 year ago

atalema commented 1 year ago

Is there a way to manage to LaunchDarkly context kinds using the terraform LD provider?

ldhenry commented 1 year ago

Hey @atalema,

Currently this is not possible today, but we do have plans to add support for this in the future. We'll be sure to update this issue when it's available.

Thanks, Henry

atalema commented 1 year ago

Thanks Henry for getting back to me. Do you've a suggestion on how to manage kinds using terraform, till we get the support using LD provider? One idea came to my mind, is to use terraform HTTP provider to communicate with LD API https://registry.terraform.io/providers/hashicorp/http/latest/docs/data-sources/http any thoughts on this one?

ldhenry commented 1 year ago

I don't have an experience with the HTTP provider but it looks like you can only use it to make GET requests. This could be useful if you want to reference an existing context kind in your Terraform config, however you would need to use something else to create and update the context kinds.

Do you have an idea on the number of context kinds you plan to manage? If the number is small you could use the LaunchDarkly UI to create and update your context kinds until the new Terraform provider resource is available.

atalema commented 1 year ago

you're right, it's allows POST but for readonly urls. Which means only supports GET scenarios. Alternatively, I found this provider https://registry.terraform.io/providers/Mastercard/restapi/latest/docs which is a full rest api provider. I believe I can use to create / update the context kind. Another option, I could write a python script which could do the job creating the kind.

They're not huge it could end up as 20+ but the problem is not about the number, is around:

Thanks for taking the time to give your thoughts on this issue.

ldhenry commented 1 year ago

That makes sense. For now, I would recommend enforcing a custom role on most members that prevents them from creating context kinds. Hopefully this can tide you over until we have a dedicated terraform provider resource available.

EDN-liamkelly commented 8 months ago

Any progress on this?

Just to extend on @atalema response. I attempted to use the Mastercard provider but the response does not return anything unique (such as the context key) which can be used to manage Terraform state. As a temporary patch, it would be good to include this so that we can at least use third party providers.

drewpc commented 5 months ago

+1