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

`custom_properties` do not update

Open lughino opened this issue 1 year ago • 3 comments
trafficstars

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

lughino avatar Mar 01 '24 15:03 lughino

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 avatar Mar 04 '24 17:03 sloloris

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.

sloloris avatar Mar 13 '24 12:03 sloloris

I hit this today (2.21) 😢 I really wish this issue was documented in the associated TF docs.

glennsarti avatar Nov 21 '24 02:11 glennsarti