-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Closed
Labels
@aws-cdk/aws-cloudwatchRelated to Amazon CloudWatchRelated to Amazon CloudWatchclosed-for-stalenessThis issue was automatically closed because it hadn't received any attention in a while.This issue was automatically closed because it hadn't received any attention in a while.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effort
Description
AlarmRule.anyOf(...alarms) where alarms is empty yields "()" which is not a valid alarm rule.
Reproduction Steps
const alarms: Array<cw.Alarm> = [];
new cw.CompositeAlarm(this, 'CompositeAlarm', {
compositeAlarmName: "CompositeAlarm",
alarmRule: cw.AlarmRule.anyOf(...alarms),
});
Adding the above to the basic example (generated by cdk init) and running cdk synth
What did you expect to happen?
I expected a valid alarm rule to be created even for cases when the list of alarms passed to anyOf is empty.
What actually happened?
Running cdk synth and checking the generated template shows the AlarmRule as () which is not valid
CompositeAlarmF4C3D082:
Type: AWS::CloudWatch::CompositeAlarm
Properties:
AlarmName: CompositeAlarm
AlarmRule: ()
Environment
- CDK CLI Version : 1.72.0
- Framework Version:
- Node.js Version: v11.13.0
- OS :
- Language (Version):
Other
This is 🐛 Bug Report
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-cloudwatchRelated to Amazon CloudWatchRelated to Amazon CloudWatchclosed-for-stalenessThis issue was automatically closed because it hadn't received any attention in a while.This issue was automatically closed because it hadn't received any attention in a while.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effort