launchdarkly / terraform-provider-launchdarkly

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

resource "launchdarkly_project" creates defaults environment #41

Closed ghost closed 3 years ago

ghost commented 3 years ago

The "launchdarkly_project" resource in the provider creates 2 defaults environments "Test" and "Production". I understand this behaviour was made necessary by the fact that a lot of your API's requires an environnment to work as defined here.

What I don't understand is why there is no official way supported by the provider to be able to create a project and an environment without having the other two defaults environment created at the same time.

This is a little bit annoying when trying to manage your Launch Darkly projects as code and getting unwanted resources.

Do you have any ideas what could be a solution to be able to support both the "launchdarkly_environment" and "launchdarkly_project" without having the default environments created?

ldhenry commented 3 years ago

Hi @jmprovencher-coveo, thanks for the feedback on this. This is actually something we have been actively working on we will have a release out in the very near future (hopefully today) that directly addresses this issue.

I'll be sure to update this issue when the new release is ready.

Thanks, Henry

ghost commented 3 years ago

Thanks @ldhenry

ldhenry commented 3 years ago

Hey @jmprovencher-coveo, we just released v1.5.0 that includes a fix for this issue.

You can now optionally specify nested environments in the launchdarkly_project resource if you wish to override the creation of the default environments.

Note: we recommend managing all of your environments either as nested environments in the launchdarkly_project resource or as separate launchdarkly_environment resources. Do not attempt to manage the same environment in both places. If you are migrating from launchdarkly_environment resources take extreme caution not to destroy or force replace your environments as this could cause your SDK keys to be cycled and may impact dependent services.

For more information, read our updated launchdarkly_project docs and see this updated config example

Thanks again for your helpful feedback, Henry