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

`custom_properties` do not update #201

Open lughino opened 7 months ago

lughino commented 7 months ago

Hi there,

I seem to have found a bug in the custom_properties field of the feature flags. Given a resource

resource "launchdarkly_feature_flag" "test_flag" {
  project_key = "default"
  key         = "test_flag"
  name        = "test_flag"
  temporary   = true
  client_side_availability {
    using_environment_id = true
    using_mobile_key     = false
  }

  variation_type = "boolean"
  variations {
    value = "true"
  }
  variations {
    value = "false"
  }

  defaults {
    on_variation  = 1
    off_variation = 1
  }

  custom_properties {
    key   = "jira.issues"
    name  = "Jira Issues"
    value = ["PROJ-43", "PROJ-51", "PROJ-52"]
  }
}

If I update the jira issues custom_properties, terraform does not pick up any changes. I tried to change/remove/add any value inside the value's list of strings but terraform seems not to recognise that that field has been updated.

Using LaunchDarkly provider version 2.18.0

sloloris commented 7 months ago

Hi @lughino,

Thanks for bringing this to our attention! I'll file a ticket internally and hopefully we can tackle this soon - we will circle back on this issue when we do. In the meantime, apologies for any inconveniences this may cause!

sloloris commented 6 months ago

Hi @lughino,

I've done a bit of digging into this and it turns out it is due to an idiosyncrasy in the Terraform SDK we are using where it is unable to detect changes in sub-attributes at plan/state refresh. Unfortunately it will take us a bit of time to migrate this resource onto the new SDK; in the meantime, if you make any changes to any other top-level field at the same time, it will update.

I realize this is wildly inconvenient and hacky, but unfortunately we've not got the time at the moment to address this properly. We have created a ticket internally to track this issue and we will keep you updated as it changes.