terraform-provider-launchdarkly icon indicating copy to clipboard operation
terraform-provider-launchdarkly copied to clipboard

Manage Kinds using Terraform

Open atalema opened this issue 2 years ago • 7 comments

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

atalema avatar Sep 13 '23 02:09 atalema

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

ldhenry avatar Sep 13 '23 10:09 ldhenry

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?

atalema avatar Sep 14 '23 00:09 atalema

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.

ldhenry avatar Sep 14 '23 09:09 ldhenry

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:

  • How can we maintain some consistency across, so we don't end up with different kinds trying to achieve the same thing. Which it would end up eating our MAU quota quickly.
  • How can we govern these changes through Infra-structure as code. We do today allow creating projects only through raising a PR for our terraform project. Which enables us to have a point of discussion with teams.

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

atalema avatar Sep 15 '23 01:09 atalema

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.

ldhenry avatar Sep 15 '23 09:09 ldhenry

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.

EDN-liamkelly avatar Mar 21 '24 13:03 EDN-liamkelly

+1

drewpc avatar May 30 '24 19:05 drewpc