-
Notifications
You must be signed in to change notification settings - Fork 24
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
Changing the env key recreates flags in all other envs as well. #143
Comments
Hey @mohamaa, I'm not sure if I fully understand the problem here but I think there might be something going on with the for loops you are using. I tried to reproduce with a simplified example and did not encounter any issues. Here is the config I was using: variable "ff_list" {
type = list(string)
default = ["flag1", "flag2"]
}
resource "launchdarkly_feature_flag" "list_flags" {
for_each = toset(var.ff_list)
project_key = "projectx"
key = each.key
name = each.key
variation_type = "boolean"
}
resource "launchdarkly_feature_flag_environment" "test_env" {
for_each = toset(var.ff_list)
flag_id = launchdarkly_feature_flag.list_flags[each.key].id
env_key = "production" # Changing this to "test" and reapplying does not cause the issue you are describing
fallthrough {
variation = 0
}
off_variation = 1
on = true
} To help us get to the bottom of this would you mind sharing what your |
Here is my variables.tf
|
Hi @mohamaa, Can you clarify what you mean by 'recreating the flags in other environments'? Do you mean it overwrites the targeting rules in other environments? If so, I concur with my colleague - something about the way you are looping may be causing the issue. I was not able to produce any strange or unexpected behavior from these configurations, but if you are still encountering this issue, please describe it in more detail so we can better work at reproducing your problem, including complete configurations if possible. |
Is there a way to ignore the recreation of flags in other envs?
I am trying launchdarkly_feature_flag_environment which maintains env-specific flag configurations.
I want to manage each envs targets differently but when I change the env it recreates the flags in other envs as well.
I am trying Lifecycle but it has no effects.
The text was updated successfully, but these errors were encountered: