fix: require StateReason before changing alarm state (#6466)

This commit is contained in:
Andre Kurait authored and GitHub committed 2026-10-24 21:56:48 -04:00
1 parent 162805c4b6
commit 87cd8ead73
4 files changed
+78 -2

No files matched your search

@@ -559,6 +559,9 @@ public class CloudWatchMetricsService {
throw SmithyValidationErrors.validationError(stateValue == null ? SmithyValidationErrors.notNull("stateValue")
: SmithyValidationErrors.notInEnum(stateValue, "stateValue", states));
}
if (stateReason == null) {
throw SmithyValidationErrors.validationError(SmithyValidationErrors.notNull("stateReason"));
}
List<AlarmSnsNotifier.Notification> notifications = List.of();
synchronized (this) {
String key = region + "::" + alarmName;