diff --git a/cdk/wo_stack.py b/cdk/wo_stack.py index def3964..05d8ac2 100644 --- a/cdk/wo_stack.py +++ b/cdk/wo_stack.py @@ -418,8 +418,12 @@ class WorkorderIngestStack(Stack): ) fallback_rate = cloudwatch.MathExpression( expression=( + # The IF volume floor (>=10) already guarantees the denominator + # is non-zero in the true branch, so divide directly. (An earlier + # MAX([...,1]) divide-by-zero guard used array syntax CloudWatch + # rejects at deploy: "Unsupported operand type(s) for MAX".) "IF((FILL(fb,0)+FILL(tmpl,0))>=10, " - "100*FILL(fb,0)/MAX([FILL(fb,0)+FILL(tmpl,0),1]), 0)" + "100*FILL(fb,0)/(FILL(fb,0)+FILL(tmpl,0)), 0)" ), using_metrics={"fb": fb_metric, "tmpl": tmpl_metric}, period=Duration.minutes(15),