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

Always showing updates in-place for `sentry_project_inbound_data_filter` for `filter_id = "legacy-browsers"`

Open srtab opened this issue 1 year ago • 0 comments

Hi,

After terraform apply for the first time and create a resource similar to the following:

# Create an inbound data filter to ignore issues raised from legacy browsers
resource "sentry_project_inbound_data_filter" "legacy_browser" {
  organization = var.organization_slug
  project      = sentry_project.this.id
  filter_id    = "legacy-browsers"
  subfilters   = ["ie_pre_9", "ie9", "ie10", "ie11", "opera_pre_15", "android_pre_4", "safari_pre_6", "opera_mini_pre_8", "edge_pre_79"]
}

If I try to terraform apply again, i always get changes to apply:

  # module.sentry_projects["project"].sentry_project_inbound_data_filter.legacy_browser will be updated in-place
  ~ resource "sentry_project_inbound_data_filter" "legacy_browser" {
        id           = "org/project/legacy-browsers"
        project   = "project"
      ~ subfilters   = [
          + "android_pre_4",
            "edge_pre_79",
            # (1 unchanged element hidden)
            "ie11",
          - "safari_pre_6",
          + "ie9",
            "ie_pre_9",
          - "android_pre_4",
            "opera_mini_pre_8",
          - "ie9",
            "opera_pre_15",
          + "safari_pre_6",
        ]
        # (2 unchanged attributes hidden)
    }

It seems the order of values has changed and terraform thinks there are changes to apply. Maybe ordering the lists from both side, terraform declared and api loaded) could solve the problem here.

srtab avatar Mar 01 '24 19:03 srtab