Skip to content
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

Permadiff in datadog_logs_index when daily_limit_reset is unset #2278

Closed
Zhann opened this issue Feb 12, 2024 · 0 comments · Fixed by #2280
Closed

Permadiff in datadog_logs_index when daily_limit_reset is unset #2278

Zhann opened this issue Feb 12, 2024 · 0 comments · Fixed by #2280
Labels

Comments

@Zhann
Copy link

Zhann commented Feb 12, 2024

Datadog Terraform Provider Version

v3.36.0

Terraform Version

v1.5.7

What resources or data sources are affected?

datadog_logs_index

Terraform Configuration Files

resource "datadog_logs_index" "main" {
  for_each = local.datadog_log_indexes

  name           = each.key
  daily_limit    = each.value.daily_limit * 1000 * 1000
  retention_days = 15

  filter {
    query = each.value.filter
  }

  dynamic "exclusion_filter" {
    for_each = each.value["exclusion_filters"]

    content {
      is_enabled = exclusion_filter.value["is_enabled"]
      name       = exclusion_filter.value["name"]

      filter {
        query       = exclusion_filter.value["filter"]["query"]
        sample_rate = exclusion_filter.value["filter"]["sample_rate"]
      }
    }
  }
}

Relevant debug or panic output

No response

Expected Behavior

Resource is idempotent.

Actual Behavior

Permadiff:

  # datadog_logs_index.main["application"] will be updated in-place
  ~ resource "datadog_logs_index" "main" {
        id                                       = "application"
        name                                     = "application"
        # (4 unchanged attributes hidden)

      - daily_limit_reset {
          - reset_time       = "14:00" -> null
          - reset_utc_offset = "+00:00" -> null
        }

        # (16 unchanged blocks hidden)
    }

  # datadog_logs_index.main["infrastructure"] will be updated in-place
  ~ resource "datadog_logs_index" "main" {
        id                                       = "infrastructure"
        name                                     = "infrastructure"
        # (4 unchanged attributes hidden)

      - daily_limit_reset {
          - reset_time       = "14:00" -> null
          - reset_utc_offset = "+00:00" -> null
        }

        # (10 unchanged blocks hidden)
    }

Note this only happens on resources with daily_limit set.

Steps to Reproduce

terraform plan
# witness diff
terraform apply
terraform plan
# witness diff is still there

### Important Factoids

_No response_

### References

https://github.com/DataDog/terraform-provider-datadog/pull/2263
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant