Terraform v0.11.11
newrelic_alert_condition
resource "newrelic_alert_condition" foo" {
condition_scope = "application"
entities = [
"${data.newrelic_application.app1.id}",
"${data.newrelic_application.app2.id}",
"${data.newrelic_application.app3id}",
]
# BUG? These seem to get re-ordered
lifecycle {
ignore_changes = ["entities"]
}
metric = "apdex"
name = "Apdex (Low)"
policy_id = "${data.terraform_remote_state.nr_monitoring.ops_policy_id}"
term {
duration = 10
operator = "below"
priority = "critical"
threshold = "0.7"
time_function = "all"
}
term {
duration = 30
operator = "below"
priority = "warning"
threshold = "0.85"
time_function = "all"
}
type = "apm_app_metric"
}
The resource should get created successfully and subsequent applies should not show any drift.
Subsequent apply shows something like:
~ newrelic_alert_condition.error_percentage_slack
entities.0: "31315057" => "2206646"
entities.1: "2206646" => "90873514"
entities.2: "90873514" => "31315057"
terraform applyterrafrom planThere's a work-around listed above in the code to ignore changes for the entities. This makes it difficult to modify the entities list though
Using a TypeSet vs. a TypeList for entities may fix this.
Hope to see this fix released soon.
Fix has been merged.
Most helpful comment
Using a TypeSet vs. a TypeList for entities may fix this.