-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
Affected Resource(s)
- coralogix_alerts_scheduler
Terraform Configuration Files
Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.
provider "coralogix" {
# api_key = ""
env = "AP1"
}
terraform {
required_version = ">= 1.0"
required_providers {
coralogix = {
source = "coralogix/coralogix"
version = "2.2.3"
}
}
}
locals {
// Build predicates from map of key -> value
_predicates = [
for k, v in var.group_by_keys : format("($d.%s:string =='%s')", trimspace(k), replace(trimspace(v), "'", "\\'") )
]
generated_what_expression = length(local._predicates) > 0 ? format("source logs | filter %s", join("&&", local._predicates)) : null
final_what_expression = coalesce(var.what_expression, local.generated_what_expression)
// Convert meta_labels map(string) -> list(object({ key, value })) as expected by provider
_meta_labels_list = [for k, v in var.meta_labels : { key = k, value = v }]
meta_labels_final = length(local._meta_labels_list) > 0 ? local._meta_labels_list : null
}
resource "coralogix_alerts_scheduler" "suppression_rule" {
name = var.name
description = var.description
enabled = var.enabled
meta_labels = local.meta_labels_final
filter = {
alerts_unique_ids = var.alerts_list
what_expression = local.final_what_expression
}
schedule = {
operation = "mute"
one_time = null
recurring = {
dynamic = var.recurring_dynamic
}
}
}Debug Output
Panic Output
- None
Expected Behavior
- After the alert scheduler rule is deleted manually in the Coralogix console, a subsequent
terraform applyshould detect drift and recreate thecoralogix_alerts_schedulerresource (or otherwise reconcile state) without error. If recreation is required, the provider should perform a replace (delete/create) rather than an update call that depends on a now-missing identifier.
Actual Behavior
- Provider attempts to update the deleted alert scheduler rule and fails with:
Invalid uuidforalertSchedulerRule.uniqueIdentifier. Terraform cannot self-heal the drift.
Steps to Reproduce
- Create an alerts scheduler via Terraform (
coralogix_alerts_scheduler). - Delete the corresponding alert scheduler in the Coralogix console.
- Run
terraform apply.
Observed: plan shows an in-place update; apply fails with Invalid uuid.
References
- N/A
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
Metadata
Metadata
Assignees
Labels
No labels