CDK:Alarm constructor statistic prop doesn't use Cfn extendedStatistic for IQM
Author: victor-xploreCreated Jan 22, 2024Updated Sep 18, 2026
Labelsbugp2package/toolseffort/medium
Describe the bug
When creating an alarm with IQM, eg
new Alarm(..., {
...,
metric: new Metric({
...,
statistic: Stats.IQM,
}),
})Expected Behavior
"ExtendedStatistic": "IQM",Current Behavior
"Statistic": "IQM",which is not valid
Reproduction Steps
import { Stack, type StackProps } from "aws-cdk-lib";
import { Alarm, ComparisonOperator, Metric, Stats } from "aws-cdk-lib/aws-cloudwatch";
import { Construct } from "constructs";
export class TestStack extends Stack {
constructor(scope: Construct, props?: StackProps) {
super(scope, "test-stack", props);
new Alarm(this, "MockAlarm", {
evaluationPeriods: 1,
threshold: 0,
comparisonOperator: ComparisonOperator.GREATER_THAN_THRESHOLD,
metric: new Metric({
namespace: "MOCK",
metricName: "TEST",
statistic: Stats.IQM,
}),
});
}
}
Possible Solution
No response
Additional Information/Context
This used to work on cdk 2.45.0
CDK CLI Version
2.122.0 (build 7e77e02)
Framework Version
No response
Node.js Version
v20.9.0
OS
Ubuntu 23.10
Language
TypeScript
Language Version
5.3.3
Other information
No response
Source: aws/aws-cdk