From e005a6543db4ab0e220eee89292e51870c4f633d Mon Sep 17 00:00:00 2001 From: Claus Matzinger Date: Thu, 14 Nov 2024 19:38:59 +0100 Subject: [PATCH] fix: overrides --- coralogix/resource_coralogix_alert.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/coralogix/resource_coralogix_alert.go b/coralogix/resource_coralogix_alert.go index f5a762ba..5965a337 100644 --- a/coralogix/resource_coralogix_alert.go +++ b/coralogix/resource_coralogix_alert.go @@ -2359,6 +2359,9 @@ func extractRatioRules(ctx context.Context, elements types.List) ([]*cxsdk.LogsR TimeWindow: timeWindow, ConditionType: logsRatioConditionSchemaToProtoMap[rule.Condition.ValueString()], }, + Override: &cxsdk.AlertDefPriorityOverride{ + Priority: alertPrioritySchemaToProtoMap[rule.Override.ValueString()], + }, } } if diags.HasError() { @@ -2657,6 +2660,9 @@ func extractMetricThresholdRules(ctx context.Context, elements types.List) ([]*c OfTheLast: ofTheLast, ConditionType: metricsThresholdConditionToProtoMap[rule.Condition.ValueString()], }, + Override: &cxsdk.AlertDefPriorityOverride{ + Priority: alertPrioritySchemaToProtoMap[rule.Override.ValueString()], + }, } } if diags.HasError() { @@ -3614,6 +3620,7 @@ func flattenLogsRatioThreshold(ctx context.Context, ratioThreshold *cxsdk.LogsRa Threshold: wrapperspbDoubleToTypeFloat64(rule.Condition.GetThreshold()), TimeWindow: timeWindow, Condition: types.StringValue(logsRatioConditionMap[rule.Condition.GetConditionType()]), + Override: types.StringValue(alertPriorityProtoToSchemaMap[rule.Override.Priority]), } } @@ -3779,6 +3786,7 @@ func flattenLogsTimeRelativeThreshold(ctx context.Context, logsTimeRelativeThres Threshold: wrapperspbDoubleToTypeFloat64(rule.Condition.GetThreshold()), ComparedTo: types.StringValue(logsTimeRelativeComparedToProtoToSchemaMap[rule.Condition.ComparedTo]), Condition: types.StringValue(logsTimeRelativeConditionMap[rule.Condition.ConditionType]), + Override: types.StringValue(alertPriorityProtoToSchemaMap[rule.Override.Priority]), } }